Skip to content

Instantly share code, notes, and snippets.

@bcnzer
Last active September 26, 2016 07:44
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 bcnzer/9abf6532bdcfc70920c420add00ac1a0 to your computer and use it in GitHub Desktop.
Save bcnzer/9abf6532bdcfc70920c420add00ac1a0 to your computer and use it in GitHub Desktop.
Example of a Startup configuration
public class Startup
// This method gets called by the runtime. Use this method to add services to the container.
// For more information on how to configure your application, visit http://go.microsoft.com/fwlink/?LinkID=398940
public Startup(IHostingEnvironment env)
{
var builder = new ConfigurationBuilder()
.SetBasePath(env.ContentRootPath)
.AddJsonFile("appsettings.json", true, true)
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", true)
.AddEnvironmentVariables();
if (env.IsDevelopment())
{
// For more details on using the user secret store see http://go.microsoft.com/fwlink/?LinkID=532709
builder.AddUserSecrets();
}
Configuration = builder.Build();
}
// other code
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment