The following code assures that the project will use the default configuration file, and will respect the appSettings.{environment}.json file :
// otherwise instantiate the default builder which will use the default appSettings.json and appSettings.{environment}.json files.var defaultBuilder = Microsoft.AspNetCore.WebHost.CreateDefaultBuilder()
.Build();
return defaultBuilder.Services.GetService<IConfiguration>();
When the configuration file name is provided explicitly the connection string will be searched for in the exact file path specified. In this case, you may set the name for the configuration file conditionally, based on the environment, for example:
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Feedback Portal
and vote to affect the priority of the items