Skip to content

Instantly share code, notes, and snippets.

@scottsauber
Created April 19, 2020 04:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scottsauber/42b7f6ad82e96bc5c35edab50e6ccf7e to your computer and use it in GitHub Desktop.
Save scottsauber/42b7f6ad82e96bc5c35edab50e6ccf7e to your computer and use it in GitHub Desktop.
var configurationBuilder = new ConfigurationBuilder()
.AddJsonFile("appsettings.json")
.AddJsonFile($"appsettings.{Environment}.json");
if (Environment.IsDevelopment())
{
configurationBuilder.AddUserSecrets();
}
configurationBuilder.AddEnvironmentVariables();
var configuration = configurationBuilder.Build();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment