Have a WPF app (VS2022 .Net 6 and Prism 8)
Want an appsettings.debug.json or similar to override the appsettings.json without changing the launch profile (just by the Debug or Release (or more) configuration.
Anyone knows how to do?
Using something like the following to build the configuration, but that relies on changed DOTNET_ENVIRONMENT variable.
IConfigurationRoot configurationRoot = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
.AddJsonFile("appsettings.json")
.AddJsonFile($"appsettings.{Environment.GetEnvironmentVariable("DOTNET_ENVIRONMENT") ?? "Production"}.json", true)
.Build();