kestrel-http-server

UseLibuv option gone after changing Microsoft.aspnetcore.all to Microsoft.NETCore.App in .net core 2.1.6

末鹿安然 提交于 2019-12-13 03:31:08
问题 I am using asp.net core 2.1.6 I have just changed my Microsoft.aspnetcore.all to Microsoft.NETCore.App as publishing the web api project is making too much size. In my code i were using use UseLibuv(o => o.ThreadCount = 1000) to set minmum thread count public static IWebHostBuilder BuildWebHost(string[] args) => WebHost.CreateDefaultBuilder(args) .UseStartup<StartupShutdownHandler>() //.UseLibuv(o => o.ThreadCount = 1000) ; Now this option is not coming. How can i set min threads now like old

How to determine which port ASP.NET Core 2 is listening on when a dynamic port (0) was specified

孤街醉人 提交于 2019-12-12 08:38:46
问题 I've got an ASP.NET Core 2.0 app which I intend to run as a stand-alone application. The app should start up and bind to an available port. To achieve this I configure the WebHostBuilder to listen on "http://127.0.0.1:0" and to use the Kestrel server. Once the web host starts listening I want to save the url with the actual port in a file. I want to do this as early as possible, since another application will read the file to interact with my app. How can I determine the port the web host is

Require SSL Client Certificate only for specific routes or controllers

北城以北 提交于 2019-12-12 07:47:59
问题 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

Why Startup's IConfigurationRoot is null?

落爺英雄遲暮 提交于 2019-12-12 05:38:25
问题 I'm trying to pass command line arguments to Startup class. Following this example, I modified my Program class and it looks like this: var builder = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("generalsettings.json", optional: false, reloadOnChange: true) .AddEnvironmentVariables(prefix: "ASPNETCORE_") .AddCommandLine(args); var config = builder.Build(); var host = new WebHostBuilder() .UseUrls("http://*:5000") .UseConfiguration(config) .UseKestrel()

dnx web error 500 when try to execute

余生长醉 提交于 2019-12-12 02:24:10
问题 I'm trying to execute in a Mac (El Capitán), the MusicStore example in ASP.NET from the official repository. I have tested it using mono and core, switching in dnvm, but no results. The dnu build is working fine with mono, with core, the build fails. When I execute dnx web, all works fine, but when I execute the project (firs load), I have a 500 error, with this error: An unhandled exception has occurred: Unable to resolve service for type 'Microsoft.Extensions.CompilationAbstractions

Kestrel: An anonymous request was received in between authentication handshake requests?

只谈情不闲聊 提交于 2019-12-11 14:59:12
问题 I created an Kestrel Asp.Net core application and tried to host it on a Windows Server ( server1 ). I launch the application using Browsing http://server1:8008 on server1 works without any error. However, when browsing http://server1:8008 on a remote machine, it gets the following error? PS C:\Websites\Portal> .\Blazor.exe --urls http://server1:8008 info: Microsoft.Hosting.Lifetime[0] Now listening on: http://[::]:8008 info: Microsoft.Hosting.Lifetime[0] Application started. Press Ctrl+C to

How to make Kestrel update on the fly with Visual Studio?

丶灬走出姿态 提交于 2019-12-11 12:32:20
问题 I have this command (default one) in project.json: "commands": { "web": "Microsoft.AspNet.Server.Kestrel" }, Now after I do run Kestrel and change my controller there is no automatic update. As far as I remember it did work in beta-8 automatically (when there was IISExpress). Is there a way to make the same now? P.S. I also did not find any command apart from Ctrl+C that closes the server that you can run in command line. Maybe there is some hidden one that restarts it? Update: It seems that

How to fix “Failed - No file” on download?

核能气质少年 提交于 2019-12-11 06:16:48
问题 I am attempting to set up files for download that will work for Chrome and IE 10-11. It works for the most part with normal file types (EXE, PNG, TXT, ..) but when attempting to download a text file without a file type, or a random type like "000" it will fail, showing "Failed - No file". Is anyone aware of what could be causing this, or how to fix it? I thought the path was somehow wrong, so I navigated to another couple files in the same directory in the browser. They showed up just fine

Can't connect to ASP.NET core through docker

谁说胖子不能爱 提交于 2019-12-11 05:39:05
问题 Hi people have been looking at this for far too long and need some help. I have made a ASP.NET core website nothing fancy just the template that goes with VS 2017 (v 1.1). I publish the site using dotnet core cli and build an image using this dockerfile: FROM microsoft/dotnet:1.1-runtime COPY /Publish /dotnetapp WORKDIR /dotnetapp EXPOSE 8444 ENTRYPOINT ["dotnet", "Inqu.dll"] When i run the image created with: docker run -it <image_name:tag> -p 8444:8444 The image starts up waiting for

Azure Key Vault Certificates does not have the Private Key when retrieved via IKeyVaultClient.GetCertificateAsync [duplicate]

你说的曾经没有我的故事 提交于 2019-12-10 14:22:43
问题 This question already has an answer here : KeyVault generated certificate with exportable private key (1 answer) Closed last year . I have 2 approaches to do the same thing, but Azure has deprecated the one that works, and the other method doesn't work. The approach that works, but is deprecated: I store my PFX in Azure Key Vault Secrets . (when I create the secret I see a warning stating that this feature is deprecated) and use the following code to retrieve it to create my certificate: