kestrel-http-server

ASP.NET Core 2.2 kestrel server's performance issue

天涯浪子 提交于 2019-12-24 18:51:53
问题 I'm facing problem with kestrel server's performance. I have following scenario : TestClient(JMeter) -> DemoAPI-1(Kestrel) -> DemoAPI-2(IIS) I'm trying to create a sample application that could get the file content as and when requested. TestClient(100 Threads) requests to DemoAPI-1 which in turn request to DemoAPI-2. DemoAPI-2 reads a fixed XML file(1 MB max) and returns it's content as a response(In production DemoAPI-2 is not going to be exposed to outside world). When I tested direct

Is is possible to host a ASP.NET Core 2 Web API NET Core 2 application in Windows Service targeting

狂风中的少年 提交于 2019-12-24 06:35:24
问题 I have a ASP.NET Core Web Web Api application targeting netcoreapp2.0 . I want to host the Kestrel server inside a Windows Service. The examples I've seen like this one https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/windows-service?tabs=aspnetcore2x are for Core Web API running on .NET Framework 4.6.1. How can I host my application in a Windows Service but still target netcoreapp2.0 ? 回答1: It is possible to host a .Net Core 2 Kestrel server inside a Windows service but you have

Launch external process (.exe) from asp.net core app

荒凉一梦 提交于 2019-12-22 22:46:36
问题 I have the following [HttpPost] public IActionResult LaunchExternalProcess() { Process.Start("C:\\Windows\\System32\\calc.exe"); return Ok(); } And this works perfectly fine on my local machine, but when deployed onto IIS 10 (windows 2016) I get no errors but it does not launch the calc on the server. I simply want to call an external .exe from a button on my page. Here is the javascript that I am using which also works on my local but no errors on server and it displays the success message $

Why Kestrel doesn't listen at specified port?

旧城冷巷雨未停 提交于 2019-12-22 18:44: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

Asp.Net core bug? Blazor/Http.Sys with Windows Authentication shows “The connection was reset”?

半世苍凉 提交于 2019-12-22 00:26:43
问题 Update: Just tried the official example https://github.com/aspnet/AspNetCore.Docs/tree/master/aspnetcore/fundamentals/servers/httpsys/samples/3.x/SampleApp and it doesn't work. Brower message: This site can’t provide a secure connection localhost sent an invalid response. Output: info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] User profile is available. Using 'C:\Users\xxx\AppData\Local\ASP.NET\DataProtection-Keys' as key repository and Windows DPAPI to encrypt keys

How to use PEM certificate in Kestrel directly?

情到浓时终转凉″ 提交于 2019-12-19 19:12:20
问题 I want to use HTTPS in my ASP.Net Core 2.0 (with Kestrel web server) application. The official documentation uses pfx format, but I want to use PEM format (generated from Let's encrypt) directly without any conversion (at least nothing outside my C# code). Is is possible? 回答1: The short answer is that you can't. At least, you can't without a whole lot of work or using something like Bouncy Castle. When the cert and the key are put together into a PFX the X509Certificate2 object will have cert

HttpRequest not aborted (cancelled) on browser abort in ASP.NET Core MVC

一个人想着一个人 提交于 2019-12-18 03:14:41
问题 I wrote the following MVC Controller to test cancellation functionality: class MyController : Controller { [HttpGet("api/CancelTest")] async Task<IActionResult> Get() { await Task.Delay(1000); CancellationToken token = HttpContext.RequestAborted; bool cancelled = token.IsCancellationRequested; logger.LogDebug(cancelled.ToString()); return Ok(); } } Say, I want to cancel the request, so the value ' true ' is logged in the controller action above. This is possible server-side if the server

How to use HTTPS / SSL with Kestrel in ASP.NET Core 2.x?

左心房为你撑大大i 提交于 2019-12-17 21:48:51
问题 I am currently using ASP.NET Core 2.x and I used to be able to get Kestrel to to use HTTPS / SSL by simply putting it in the UseUrls() method like so: var host = new WebHostBuilder() .UseUrls("http://localhost", "https://111.111.111.111") .UseKestrel() .Build(); But now I get the exception: System.InvalidOperationException: HTTPS endpoints can only be configured using KestrelServerOptions.Listen(). How do I configure Kestrel to use SSL in ASP.NET Core 2.x? 回答1: The basics. Using Server URLs

Configure ASP.NET Core 2.0 Kestrel for HTTPS

我的梦境 提交于 2019-12-17 17:57:08
问题 TL;DR What is today the correct way to setup HTTPS with ASP.NET Core 2.0? I would like to configure my project to use https and a certificate like they have shown at BUILD 2017. I have tried several settings but nothing worked. After some research, I am even more confused. It seems that there are many ways to configure URLs and ports… I have seen appsettings.json , hosting.json , via code, and in launchsettings.json we can also set the URL and port. Is there a "standard" way to do it? Here is

web.config in ASP.NET 5 MVC 6

白昼怎懂夜的黑 提交于 2019-12-13 15:08:30
问题 I have a WCF .dll that loads configuration from web.config file. I'm using that dll in asp.net 5 application, when I try to call a function from dll, I'm getting exception: Could not find default endpoint element that references contract 'WebService.MyWebService' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element. The