net core3.0配置项目端口号
电脑版发表于:2019/12/11 16:19
net core2.0是这样的:
public static IWebHostBuilder CreateWebHostBuilder(string[] args) => WebHost.CreateDefaultBuilder(args) .UseStartup<Startup>() .UseKestrel() .UseUrls("http://*:8093", "https://*:5001");
3.0是这样的:
public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>(); webBuilder.UseKestrel(); webBuilder.UseUrls("http://*:44396", "https://*:44392"); });
区别不大但要注意3.0用了lamdba的