春春配小四,css教程,吓死你爽子
配置文件 hosting.json。例:
通过查看webhost源码我们得知,启动后会先读取相关配置参数,
internal class webhost:iwebhost { private static readonly string deprecatedserverurlskey = "server.urls"; //... private void ensureserver() { if (server == null) { //... if (addresses != null && !addresses.isreadonly && addresses.count == 0) { var urls = _config[webhostdefaults.serverurlskey] ?? _config[deprecatedserverurlskey]; } } } } public static class webhostdefaults{ public static readonly string serverurlskey = "urls"; //... }
{"server.urls": "http://localhost:5003;http://localhost:5004"}
public class program { public static void main(string[] args) { var config = new configurationbuilder() .setbasepath(directory.getcurrentdirectory()) .addjsonfile("hosting.json", true) .build(); buildwebhost(args, config).run(); //buildwebhost(args).run(); } public static iwebhost buildwebhost(string[] args, iconfiguration config) => webhost.createdefaultbuilder(args) .usekestrel() // .useurls("http://*:5001", "http://*:5002") .useconfiguration(config) .usestartup<startup>() .build(); }
自定义服务器
linux
- centos7.2
windows
iis
windows服务
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
Net Core Web Api项目与在NginX下发布的方法
asp.net core3.1 引用的元包dll版本兼容性问题解决方案
IdentityServer4实现.Net Core API接口权限认证(快速入门)
ASP.NET Core MVC通过IViewLocationExpander扩展视图搜索路径的实现
网友评论