Skip to content

Instantly share code, notes, and snippets.

@dcomartin
Created March 3, 2017 00:58
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 dcomartin/b74184de85abe7f799f42ac8c838f802 to your computer and use it in GitHub Desktop.
Save dcomartin/b74184de85abe7f799f42ac8c838f802 to your computer and use it in GitHub Desktop.
public Startup(IHostingEnvironment env)
{
_env = env;
var builder = new ConfigurationBuilder()
.SetBasePath(env.ContentRootPath)
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
.AddEnvironmentVariables();
if (env.IsDevelopment())
{
builder.AddUserSecrets();
}
Configuration = builder.Build();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment