在Program.cs中
public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .ConfigureWebHostDefaults(webBuilder => { webBuilder.UseUrls("Http://*:7200"); webBuilder.UseStartup<Startup>(); });