I updated my project from 1.0.0-rc1-final to 1.0.0-rc2-final which is called ASP.NET Core 2 now. This is how I initialize the configuration builder:
var builder = new ConfigurationBuilder().SetBasePath(Environment.GetEnvironmentVariable("ASPNETCORE_CONTENTROOT")).AddJsonFile(file).AddEnvironmentVariables();
IConfiguration configuration = builder.Build();
It turns out that one can no longer do something like:
var allSettingsInSection = configuration.Get(typeof(StronglyTypedConfigSection), sectionName);
Instead, it has to be done like this now:
IConfigurationSection sectionData = configuration.GetSection(sectionName); var section = new StronglyTypedConfigSection(); sectionData.Bind(section);
Note that it's necessary to include Microsoft.Extensions.Configuration.Binder in project.json.