Automatically set appsettings.json for dev and release environments in asp.net core?
I've defined some values in my appsettings.json for things like database connection strings, webapi locations and the like which are different for development, staging and live environments. Is there a way to have multiple appsettings.json files (like appsettings.live.json , etc, etc) and have the asp.net app just 'know' which one to use based on the build configuration it's running? You may use conditional compilation: public Startup(IHostingEnvironment env) { var builder = new ConfigurationBuilder() .SetBasePath(env.ContentRootPath) .AddJsonFile("appsettings.json", optional: true,