Questions tagged «kestrel»

3
ASP.NET Core中Program.Main中的访问环境名称
使用ASP.NET Mvc Core,我需要将开发环境设置为使用https,因此我Main在Program.cs中的方法中添加了以下内容: var host = new WebHostBuilder() .UseContentRoot(Directory.GetCurrentDirectory()) .UseIISIntegration() .UseStartup<Startup>() .UseKestrel(cfg => cfg.UseHttps("ssl-dev.pfx", "Password")) .UseUrls("https://localhost:5000") .UseApplicationInsights() .Build(); host.Run(); 如何在此处访问托管环境,以便可以有条件地设置协议/端口号/证书? 理想情况下,我将只使用CLI来像这样操纵主机环境: dotnet run --server.urls https://localhost:5000 --cert ssl-dev.pfx password 但是似乎没有从命令行使用证书的方法。
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.