dont reload appsettings.json at runtime (#2093)

* dont reload appsettings.json at runtime

* also disable here
This commit is contained in:
Jason Dove
2025-06-29 17:15:34 +00:00
committed by GitHub
parent 7457301d3e
commit cd28afcd91
4 changed files with 11 additions and 3 deletions
+2 -1
View File
@@ -27,7 +27,7 @@ public class Program
Configuration = builder
.SetBasePath(BasePath)
.AddJsonFile("appsettings.json", false, true)
.AddJsonFile("appsettings.json", false, reloadOnChange: false)
.AddJsonFile(
$"appsettings.{Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Production"}.json",
true)
@@ -117,6 +117,7 @@ public class Program
try
{
Environment.SetEnvironmentVariable("DOTNET_HOSTBUILDER__RELOADCONFIGONCHANGE", "false");
await CreateHostBuilder(args).Build().RunAsync();
return 0;
}