.UseDefaultHostingConfiguration(args) has been removed.
To have equivalent behavior from before you can add:
var config = new ConfigurationBuilder()
.AddJsonFile("hosting.json", optional: true)
.AddEnvironmentVariables(prefix: "ASPNETCORE_")
.AddCommandLine(args)
.Build();
var host = new WebHostBuilder()
.XYZ()
.UseConfiguration(config)
.ZYX()
.Build();
And also ensure the application's project.json file has references to these NuGet packages:
Microsoft.Extensions.Configuration.ComandLine
Microsoft.Extensions.Configuration.EnvironmentVariables
Microsoft.Extensions.Configuration.Json
In addition ASPNETCORE_ENVIRONMENT is included as a fallback if you don't add a setting for "environment" yourself.
Most apps don't need all these settings though.
Issues causing the removal of UseDefaultHostingConfiguration are aspnet/Hosting#700 and aspnet/Hosting#727
Please use aspnet/Hosting#737 for discussion
.UseDefaultHostingConfiguration(args)has been removed.To have equivalent behavior from before you can add:
And also ensure the application's
project.jsonfile has references to these NuGet packages:Microsoft.Extensions.Configuration.ComandLineMicrosoft.Extensions.Configuration.EnvironmentVariablesMicrosoft.Extensions.Configuration.JsonIn addition
ASPNETCORE_ENVIRONMENTis included as a fallback if you don't add a setting for "environment" yourself.Most apps don't need all these settings though.
Issues causing the removal of
UseDefaultHostingConfigurationare aspnet/Hosting#700 and aspnet/Hosting#727Please use aspnet/Hosting#737 for discussion