kestrel-http-server

Windows Authentication works on IIS but not Kestrel / Microsoft.AspNetCore.Authentication.Negotiate (not in Chrome, sometimes in Edge, always in IE)?

只愿长相守 提交于 2020-01-01 15:11:36
问题 I created a new Blazor (Server-side) application with Windows Authentication and run it using IIS Express. It will display a message of "Hello Domain\User!" from the following razor component ( ...\BlazorApp1\BlazorApp1\Shared\LoginDisplay.razor ) on top right. <AuthorizeView> Hello, @context.User.Identity.Name! </AuthorizeView> If running using Kestrel, the message is not shown. So I tried the following steps to make it work in Kestrel. Import NuGet package Microsoft.AspNetCore

Windows Authentication works on IIS but not Kestrel / Microsoft.AspNetCore.Authentication.Negotiate (not in Chrome, sometimes in Edge, always in IE)?

你离开我真会死。 提交于 2020-01-01 15:09:31
问题 I created a new Blazor (Server-side) application with Windows Authentication and run it using IIS Express. It will display a message of "Hello Domain\User!" from the following razor component ( ...\BlazorApp1\BlazorApp1\Shared\LoginDisplay.razor ) on top right. <AuthorizeView> Hello, @context.User.Identity.Name! </AuthorizeView> If running using Kestrel, the message is not shown. So I tried the following steps to make it work in Kestrel. Import NuGet package Microsoft.AspNetCore

Recycle of App Pool kills Kestrel but does not restart

假装没事ソ 提交于 2020-01-01 13:15:12
问题 Background When hosting a (non-Core) ASP.net site on IIS 8+ it is possible to utilize the IIS Application Initialization Module to pro-actively initialize ('warm-up') a web application when IIS starts up (or, I believe, when an app pool is recycled). As far as I know, this is not possible when hosting a .net Core app on IIS. I have also noticed that when hosting a .net Core (1.1) app on IIS, the dotnet.exe process (Kestrel) is killed as part of an application pool recycle event. This process

Check if hosting server is IIS or Kestrel at runtime in aspnet core

北城余情 提交于 2020-01-01 09:33:29
问题 I'm currently running my application under either Kestrel (locally) or IIS InProcess (production). return WebHost.CreateDefaultBuilder(args) .ConfigureKestrel(options => options.AddServerHeader = false) .UseIIS() .UseStartup<Startup>(); I'd like to be able to get the hosting server name at runtime in a controller so I can achieve the following: if (hostingServer == "kestrel") { DoSomething(); } else { DoSomethingElse(); } In this specific case it's to get around the fact that non-ascii

Start multiple background threads inside Self Hosted ASP.NET Core Microservice

那年仲夏 提交于 2019-12-30 07:42:10
问题 Where can i create multiple long running background threads in Self Hosted Self Contained ASP.NET Core Microservice whose lifetime is same as micro-service lifetime? So that information retrieved from threads can be sent as a response to the requests. Tried given code but it reduces http request performance when background threads are busy. Main method of Program.cs file is: static void Main(string[] args) { //Start background thread1 //Start background thread2 //Around 10 background threads

.Net Core behind NGINX returns 502 Bad Gateway after authentication by IdentityServer4

若如初见. 提交于 2019-12-30 07:42:08
问题 Having to applications auth and store and authenticating using IdentityServer4 and both are behind NGINX. The store application successfully authenticates but after coming back from the auth application we get 502 Bad Gateway from NGINX. Any idea what is going wrong here? Auth app log: info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] Request finished in 117.7292ms 200 text/html; charset=UTF-8 info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] Request starting HTTP/1.0 POST http:/

Start multiple background threads inside Self Hosted ASP.NET Core Microservice

我与影子孤独终老i 提交于 2019-12-30 07:41:33
问题 Where can i create multiple long running background threads in Self Hosted Self Contained ASP.NET Core Microservice whose lifetime is same as micro-service lifetime? So that information retrieved from threads can be sent as a response to the requests. Tried given code but it reduces http request performance when background threads are busy. Main method of Program.cs file is: static void Main(string[] args) { //Start background thread1 //Start background thread2 //Around 10 background threads

How to watch for file changes “dotnet watch” with Visual Studio ASP.NET Core

断了今生、忘了曾经 提交于 2019-12-29 04:33:12
问题 I am using Visual Studio with ASP.NET Core and run the web site using just F5 or Ctrl+F5 (not using command line directly). I would like to use the "dotnet watch" functionality to make sure all changes are picked up on the fly to avoid starting the server again. It seems that with command line you would use "dotnet watch run" for this, but Visual Studio uses launchSettings.json and does it behind the scenes if I understand it correctly. How can I wire up "dotnet watch" there? 回答1: Open

WebApi giving 404 whilst debugging; works when published

大兔子大兔子 提交于 2019-12-29 00:53:13
问题 I have a console application written in .NET Core 2.2.6 that is using Kestrel to host a simple WebApi. public class SettingsController : Controller { // // GET: /settings/ public string Index() { return $"Hello world! controller"; } } If I publish the code and run the executable, I can visit http://127.0.0.1:310/settings and see the expected "Hello world! controller". However, if I debug (or even open in Release mode) from inside Visual Studio 2019, the same URL throws a 404 exception. Some

How to host the Kestrel server in a test?

时光毁灭记忆、已成空白 提交于 2019-12-25 01:37:03
问题 I need to test my ASP.NET Core routes and other configuration of my IWebHost , along with WebSocket code. For this I believe actually hosting Kestrel within my automated tests is the best approach. How can I host configure the IWebHost such that it listens to an HttpMessageHandler that I have prepared instead of listening on an actual port so I can mock up messages handed to it? Or is there a better way? I can't even find a property that discloses which port it listens to by default. 回答1: you