-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Closed
Labels
Priority:2Work that is important, but not critical for the releaseWork that is important, but not critical for the releaseanalyzerIndicates an issue which is related to analyzer experienceIndicates an issue which is related to analyzer experiencearea-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcfeature-minimal-hostingold-area-web-frameworks-do-not-use*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels
Milestone
Description
The WebApplicationBuilder has top level properties to remove some of the callback noise and we should push developers towards using those properties in their code since they are the moral equivalent to the Configure* callbacks:
var builder = WebApplication.CreateBuilder(args);
builder.Host.ConfigureAppConfiguration(builder =>
{
builder.AddJsonFile("foo.json", optional: true);
});
// OR
builder.Host.ConfigureHostConfiguration(builder =>
{
builder.AddJsonFile("foo.json", optional: true);
});
// OR
builder.WebHost.ConfigureAppConfiguration(builder =>
{
builder.AddJsonFile("foo.json", optional: true);
});
Should be rewritten to:
var builder = WebApplication.CreateBuilder(args);
builder.Configuration.AddJsonFile("foo.json", optional: true);
Metadata
Metadata
Assignees
Labels
Priority:2Work that is important, but not critical for the releaseWork that is important, but not critical for the releaseanalyzerIndicates an issue which is related to analyzer experienceIndicates an issue which is related to analyzer experiencearea-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcfeature-minimal-hostingold-area-web-frameworks-do-not-use*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels