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