在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
添加host.json文件 { "urls": "https://localhost:44389;http://localhost:44380" }
在Program.cs中修改CreateWebHostBuilder方法 public static IWebHostBuilder CreateWebHostBuilder(string[] args) { var configuration = new ConfigurationBuilder().SetBasePath(Environment.CurrentDirectory) .AddJsonFile("host.json") .Build(); var url = configuration["urls"]; return WebHost.CreateDefaultBuilder(args) .UseUrls(url) .UseStartup<Startup>(); }
运行
添加host.json文件 { "urls": "https://localhost:44389;http://localhost:44380" }
在Program.cs中修改CreateWebHostBuilder方法 public static IWebHostBuilder CreateWebHostBuilder(string[] args) { var configuration = new ConfigurationBuilder().SetBasePath(Environment.CurrentDirectory) .AddJsonFile("host.json") .Build(); var url = configuration["urls"]; return WebHost.CreateDefaultBuilder(args) .UseUrls(url) .UseStartup<Startup>(); }
运行
|
请发表评论