改用Host.CreateDefaultBuilder,支持appsettings中的urls配置
智能大石头
authored at
2023-01-31 18:20:38
Stardust
using System;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using NewLife.Log;
namespace Stardust.Web
{
public class Program
{
public static void Main(String[] args)
{
XTrace.UseConsole();
CreateWebHostBuilder(args).Build().Run();
}
public static IHostBuilder CreateWebHostBuilder(String[] args)
{
var builder = Host.CreateDefaultBuilder(args);
builder.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
});
return builder;
}
}
}
|