kestrel-http-server

Thread management in asp.net core / kestrel

血红的双手。 提交于 2019-12-03 12:36:54
I'm troubleshooting performance / scalability issues with an asp.net app we've migrated to asp.net core 2.0. Our app is hosted on azure as an app service, and is falling over far too easily with any moderate traffic. One thing that's puzzling me is how multiple concurrent requests are handled. From what I've read here , Kestrel uses multiple event loops to handle your requests. But the actual user code is handled on the .net thread pool ( that's from here ). So, as an experiment - I've created a new asp.net core 2.0 MVC app, and added a rather nasty action method: [AllowAnonymous] public

Require SSL Client Certificate only for specific routes or controllers

送分小仙女□ 提交于 2019-12-03 12:05:12
I have an ASP.NET MVC Core project using Kestrel as the server. It is both serving up user content (asp.net mvc) and hosts web API controllers that agents (software) communicate with. I have enabled HTTPS and client certificate support. The issue is that I want to require client certificates for agents (software) that call Web APIs but I do not want to require/prompt for client certificates for regular browser based users. I have enabled HTTPS/client certificate support the following way: var host = new WebHostBuilder() .UseKestrel(options => { HttpsConnectionFilterOptions httpsoptions = new

Setting index.html as default page in asp.net core

别来无恙 提交于 2019-12-03 04:22:53
How can I get asp.net core to serve an index.html file from inside my wwwroot? The reason I want to do this is because I an developing an angular 4 app using the angular CLI and it takes care of the entire build process. I have set it up to build into the wwwroot directory of my asp.net core project but asp.net core doesn't want to serve it. At first I tried to return the html file through a controller. I tried this route: app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}"); }); And then in the controller I return the html file like this:

Using WebListener or OWIN as API Gateway for azure service fabric

醉酒当歌 提交于 2019-12-02 13:31:36
问题 We have 4 stateless services microservice in service fabrics which are using Kestrel as server. We need to expose those 4 services to the front end and have question regarding either to use WebListener or OWIN as server. Can any one tell which is better for performance. And also we have authentication service which is used to handle tokens. 回答1: By OWIN I'm assuming you're referring to Katana with Web API 2, which both implement OWIN. In that case, the choice is really between "classic" Web

WebApi giving 404 whilst debugging; works when published

痴心易碎 提交于 2019-12-01 07:03:34
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 other code that might help pinpoint the problem: public static IWebHostBuilder CreateWebHostBuilder

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

早过忘川 提交于 2019-12-01 00:59:50
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://auth.example.com/connect/token application/x-www-form-urlencoded 279 info: IdentityServer4.Hosting

ASP.NET 5 add app as IIS application

心已入冬 提交于 2019-11-30 22:01:41
I'm in the process of migrating some applications from ASP.NET 5 beta7 to RC1. Using HTTPPlatformHandler I am able to run any of these ASP.NET 5 RC1 applications as the root of an IIS site. But they will not run as a subdir (right-click 'add application') of the site. The full response shows: HTTP/1.1 404 Not Found Content-Length: 0 Server: Kestrel X-Powered-By: ASP.NET Date: Tue, 24 Nov 2015 14:59:04 GMT It isn't a permissions issue, as the route is served successfully when the app is the root of the site and using the same app pool. The app pool is configured for 'no managed code' and

Unable to load application or execute command 'Microsoft.AspNet.Server.Kestrel'

本小妞迷上赌 提交于 2019-11-30 21:14:35
I am trying to deploy my ASP.NET 5 WebApi to a remote server (Windows server 2008 R2) and am having trouble getting it to run correctly with IIS. project.json { "webroot": "wwwroot", "version": "1.0.0-*", "dependencies": { "App.Data": "1.0.0-*", "App.Model": "1.0.0-*", "App.Repository": "1.0.0-*", "App.ViewModel": "1.0.0-*", "AutoMapper": "4.1.1", "Microsoft.AspNet.Authentication": "1.0.0-rc2-16009", "Microsoft.AspNet.Authentication.JwtBearer": "1.0.0-rc2-16009", "Microsoft.AspNet.Diagnostics": "1.0.0-rc2-16136", "Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc2-15873", "Microsoft.AspNet.Mvc":

How to get a Console output in ASP.NET Core with IIS Express

回眸只為那壹抹淺笑 提交于 2019-11-30 18:22:35
ASP.Net Core documentation here has a nice console logging output like in the picture below with colors for various LogLevels. I have now created an application in Visual Studio and I see that it now runs behind IIS Express and I don't see the console anymore. I remember when I did run beta, then it did pop up Kestrel directly with this nice Console output. Is it possible to get this nice window now? P.S. It's a bit strange that the documentation still contains these images that you cannot even see. Yes, it's possible with IIS Express. Use Microsoft.Extensions.Logging.Debug nuget package:

ASP.NET 5 add app as IIS application

妖精的绣舞 提交于 2019-11-30 17:59:33
问题 I'm in the process of migrating some applications from ASP.NET 5 beta7 to RC1. Using HTTPPlatformHandler I am able to run any of these ASP.NET 5 RC1 applications as the root of an IIS site. But they will not run as a subdir (right-click 'add application') of the site. The full response shows: HTTP/1.1 404 Not Found Content-Length: 0 Server: Kestrel X-Powered-By: ASP.NET Date: Tue, 24 Nov 2015 14:59:04 GMT It isn't a permissions issue, as the route is served successfully when the app is the