kestrel-http-server

Determine port Kestrel binded to

偶尔善良 提交于 2019-12-07 01:50:49
问题 I'm writing a simple ASP.NET Core service using ASP.NET Core empty ( web ) template. By default, it binds to port 5000 but I would like it to bind to a random available port on the system. I can do so by modifying BuildWebHost to: public static IWebHost BuildWebHost(string[] args) => WebHost.CreateDefaultBuilder(args) .UseStartup<Startup>() .UseUrls("http://*:0") // This enables binding to random port .Build(); It binds to a random port but how do I determine from within the application which

Stop a running dotnet core website running on kestrel

时光毁灭记忆、已成空白 提交于 2019-12-06 19:03:01
问题 When deploying a new version of an existing .net core website. How do I first safely stop the old running kestrel app? Here is an exmaple of what I would like to write (Pseudo deployment script): dotnet stop mysite/mysite.dll <---- this line here mv mysite/ mysite.bak/ cp newly-published-mysite/ mysite/ dotnet run mysite/mysite.dll killall dotnet seems a little unsafe. How would it work if I were hosting two small sites on one box? 回答1: Accordingly to this discussion, there is no safe way to

Debugging Web Project w/ Visual Studio Code + ASP.NET 5 + Mono + Kestrel + OS X

好久不见. 提交于 2019-12-06 08:41:20
问题 I'm pretty new to OS X (4 days with my new mac), and I am working on setting up an environment where I can debug my Asp.Net 5 web project locally with the debugger built into Visual Studio Code, specifically getting the breakpoint to work when attaching to mono. I followed these instructions for installing asp.net 5 and visual studio code. (http://docs.asp.net/en/latest/getting-started/installing-on-mac.html) I then installed yeoman, and scaffolded out an aspnet project. I ran commands dnu

Why Kestrel doesn't listen at specified port?

好久不见. 提交于 2019-12-06 08:38:37
I am trying to create web application using kestrel. In this article https://docs.microsoft.com/pl-pl/aspnet/core/fundamentals/servers/kestrel?tabs=aspnetcore2x there is explanation how to use kestrel (code below): public static IWebHost BuildWebHost(string[] args) => WebHost.CreateDefaultBuilder(args) .UseStartup<Startup>() .UseKestrel(options => { options.Listen(IPAddress.Loopback, 5000); }) .Build(); IIS starts default at port 49950 but nothing is listening on port 5000. Why it doesn't work? Am I missing something? I want to force kestrel to listen on 5000 from code only (without

Asp.net Core RC2 how to disable Transfer-Encoding: chunked on response

自古美人都是妖i 提交于 2019-12-06 07:15:49
I'm having issues with certain http clients (Matlab and KDB) having problems with chunked http responses. Is there a way to disable chunked responses in Kestrel? Tratcher Specify the content-length for responses. This may require buffering. 来源: https://stackoverflow.com/questions/37839877/asp-net-core-rc2-how-to-disable-transfer-encoding-chunked-on-response

BadHttpRequestException due to MinRequestBodyDataRate and poor connection

醉酒当歌 提交于 2019-12-06 03:53:59
问题 I have an ASP.NET Core web application that accepts file uploads from authenticated users, along with some error handling to notify me when an exception occurs (Exceptional). My problem is I'm periodically getting alerts of BadHttpRequestException s due to users accessing the application via mobile devices in areas with unreliable coverage. I used to get this with 2.0 too, but until the exception description got updated in 2.1, I never knew it was specifically related to

To which process should I attach Visual Studio Debugger to debug a Kestrel application?

被刻印的时光 ゝ 提交于 2019-12-06 01:06:22
问题 I am bringing up command line and running my app using dotnet run command. This starts Kestrel and brings up my application. How should I go with identify to which process to attach debugger so I can debug the website that Kestrel now hosts? I specifically need to be able to do it this way - meaning I can't use standard F5. 回答1: Unfortunately, there is no way to tell right now using the tools provided by Visual Studio or .NET Core. Notice, though, that the community has already requested for

Why does ASP.NET 5 on Linux require kestrel?

牧云@^-^@ 提交于 2019-12-05 18:55:59
问题 I am trying to understand the entire web/framework/application stack when installing ASP.NET 5 on Linux. All the instructions I have read, including this one haven't really answered my question: Why can't Nginx server work without Kestrel like here: http://www.mono-project.com/docs/web/fastcgi/nginx/ ? Or am I way off. I'm trying to understand what the reason is for this structure: .NET Core(or mono) --> Kestrel --> Nginx Isn't Kestrel just another web server like Nginx but with a lot less

Kestrel + IIS Reverse Proxy RequestAborted Not Triggered

随声附和 提交于 2019-12-05 16:15:38
We have an ASP.NET Core 2.x Application that implements custom middleware that acts as a proxy in front of another (Java based) server/application. It is common for the clients of this application/middleware to frequently abort/cancel their request before the server request has completed. We've deployed this application to IIS (as a reverse proxy) and running on Kestrel. Prior to Core 2.x Kestrel had a bug that caused HttpContext.RequestAborted to always be false (other related question here )...which was apparently fixed in 2.x (which I've been able to confirm). However, it appears that when

Visual Studio keeps adding IIS Express back into my launchsettings.json

↘锁芯ラ 提交于 2019-12-05 14:51:54
问题 I am trying to remove the IIS Express profile from my .NET Core launch settings but every time i repoen the solution, Visual Studio adds it back in again. For example, in a new project my launch settings looks like this { "iisSettings": { "windowsAuthentication": false, "anonymousAuthentication": true, "iisExpress": { "applicationUrl": "http://localhost:55735/", "sslPort": 0 } }, "profiles": { "IIS Express": { "commandName": "IISExpress", "launchBrowser": true, "environmentVariables": {