public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseHttpSys(options =>
{
options.UrlPrefixes.Add("how to get url from appsettings");
});
webBuilder.UseStartup<Startup>();
})
//host as window service
.UseWindowsService();
}
应用设置配置,
"HttpSysOptions": {
"UrlPrefix": "http://localhost:8099/"
}
貌似可以用hostingContext.Configuration
,但是里面不可用UseHttpSys
,怎么办?谢谢!