升级net8 Program修改
parent
6553bd70c5
commit
b4df799a37
|
@ -74,16 +74,10 @@ if (urlsIndex > -1)
|
|||
|
||||
NewId.SetProcessIdProvider(new CurrentProcessIdProvider());
|
||||
|
||||
|
||||
builder.Configuration.AddJsonFile("appsettings.json", false, true)
|
||||
.AddJsonFile($"appsettings.{enviromentName}.json", false, true);
|
||||
|
||||
builder.Host
|
||||
.ConfigureAppConfiguration((hostContext, config) =>
|
||||
{
|
||||
|
||||
//Console.WriteLine(hostContext.HostingEnvironment.EnvironmentName);
|
||||
config.AddJsonFile("appsettings.json", false, true)
|
||||
.AddJsonFile($"appsettings.{enviromentName}.json", false, true);
|
||||
})
|
||||
.UseServiceProviderFactory(new AutofacServiceProviderFactory())
|
||||
.ConfigureContainer<ContainerBuilder>(containerBuilder =>
|
||||
{
|
||||
|
@ -247,15 +241,11 @@ app.UseCors(t => t.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader());
|
|||
app.UseAuthentication();
|
||||
app.UseAuthorization();
|
||||
|
||||
app.MapControllers();
|
||||
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
endpoints.MapControllers();
|
||||
app.MapHub<UploadHub>("/UploadHub");
|
||||
app.MapHealthChecks("/health");
|
||||
|
||||
endpoints.MapHub<UploadHub>("/UploadHub");
|
||||
|
||||
endpoints.MapHealthChecks("/health");
|
||||
});
|
||||
|
||||
// Serilog
|
||||
SerilogExtension.AddSerilogSetup(enviromentName, app.Services);
|
||||
|
|
Loading…
Reference in New Issue