kestrel-http-server

Asp.net Core RequestSizeLimit still executes action

醉酒当歌 提交于 2020-05-15 02:20:26
问题 I am using ASP.net Core 2.0 with MVC. I have a controller action that I want to limit the request size to 1MB. I added the RequestSizeLimit attribute like so: [HttpPost] [Authorize] [RequestSizeLimit(1_000_000)] public async Task<List<ResourceUploadResult>> Upload([FromBody]List<Resource> updatedList){ //.... } When the upload is < 1MB, it works as expected. When it is > 1MB I expected the server to return a status of 413, but instead, the updatedList parameter is null and the action executes

aspnetcore 2.0 kestrel unix socket behind nginx

懵懂的女人 提交于 2020-04-30 08:12:42
问题 I am current using aspnet core behind nginx through http requests in Ubuntu 16. And I'd like to switch to unix socket. In my program.cs I have: var host = default(IWebHost); var builder = new WebHostBuilder() .UseKestrel(opt => { if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) && settings.Config.ListenUnixSocket) { opt.ListenUnixSocket("/tmp/api.sock"); } }) .Configure(app => { app.Map("/health", b => b.Run(async context => { context.Response.StatusCode = (int)HttpStatusCode.OK; await

aspnetcore 2.0 kestrel unix socket behind nginx

ぃ、小莉子 提交于 2020-04-30 08:11:18
问题 I am current using aspnet core behind nginx through http requests in Ubuntu 16. And I'd like to switch to unix socket. In my program.cs I have: var host = default(IWebHost); var builder = new WebHostBuilder() .UseKestrel(opt => { if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) && settings.Config.ListenUnixSocket) { opt.ListenUnixSocket("/tmp/api.sock"); } }) .Configure(app => { app.Map("/health", b => b.Run(async context => { context.Response.StatusCode = (int)HttpStatusCode.OK; await

Set Kestrel Unix socket file permissions in ASP.NET Core?

女生的网名这么多〃 提交于 2020-03-04 20:31:43
问题 Kestrel can be configured to use a Unix socket to communicate with a reverse proxy (i.e. nginx) for a slight performance advantage. However, the socket file is deleted and recreated each time the kestrel server stops/starts, resetting the socket's permissions and depending on system configuration, blocking nginx from accessing the socket. What is a simple and reliable method to ensure Kestrel's Unix socket permissions are opened up on creation? 回答1: The following sample Program.Main

.net core AspnetCore Razor views fail with CompilationFailedException

亡梦爱人 提交于 2020-03-01 07:12:01
问题 When i try and view my Razor pages i get the following fail: Microsoft.AspNetCore.Server.Kestrel[13] Connection id "0HLFVN3H0G8MT", Request id "0HLFVN3H0G8MT:00000001": An unhandled exception was thrown by the application. Microsoft.AspNetCore.Mvc.Razor.Compilation.CompilationFailedException: One or more compilation failures occurred: jhhodq42.4nm(4,41): error CS0234: The type or namespace name 'Razor' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly

.net core AspnetCore Razor views fail with CompilationFailedException

自作多情 提交于 2020-03-01 07:11:13
问题 When i try and view my Razor pages i get the following fail: Microsoft.AspNetCore.Server.Kestrel[13] Connection id "0HLFVN3H0G8MT", Request id "0HLFVN3H0G8MT:00000001": An unhandled exception was thrown by the application. Microsoft.AspNetCore.Mvc.Razor.Compilation.CompilationFailedException: One or more compilation failures occurred: jhhodq42.4nm(4,41): error CS0234: The type or namespace name 'Razor' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly

Kestrel webserver for Asp.Net Core - does it recycle / reload after some time

假如想象 提交于 2020-02-23 09:13:06
问题 Simple noob question :-) I'm about to go into production with a small .NET core app host that's hosted in a droplet at digitalocean. I've always hosted websites using IIS, but I would like to move to linux distributions and use nginx as reverse proxy. My question is as the title says :-) Does kestrel every need to recycle a "application pool" like the IIS does? If not, does that mean the application is loaded from Kestrel is online until it's shut down? Best regards Jens 回答1: Based on bits of

Visual Studio 2017 Enable SSL

拥有回忆 提交于 2020-01-22 04:47:31
问题 How do you enable SSL for a project in Visual Studio 2017? In VS15, I could select Project -> Properties -> Debug -> Enable SSL. This option is not available in VS2017. Where has it moved to? Edit: I've even tried editing .\vs\config\applicationhost.config to no avail: <listenerAdapters> <add name="http" /> <add name="https" /> </listenerAdapters> <sites> <site name="WebSite1" id="1" serverAutoStart="true"> <application path="/"> <virtualDirectory path="/" physicalPath="%IIS_SITES_HOME%

kestler MaxRequestBodySize uploading file over the limit

廉价感情. 提交于 2020-01-15 08:43:33
问题 I did encounter a wierd problem with kestrel. I am not able to upload the multiple files which exceed the kestrel's MaxRequestBodySize. The expected behaviour is to throw the BadHttpRequestException when I am trying to reader this.Request.Form.Files.GetFiles() . I do expect to recieve request to controller action only once. What is happening is that the upload action is hit a few time and browser with message "conection lost". I did not find a patter on how mamy times the action is called.