Skip to content

Instantly share code, notes, and snippets.

IHostEnvironment env = hostingContext.HostingEnvironment;
configuration
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", true, true);