JetBrains Rider gave me this:
https://learn.microsoft.com/aspnet/core/diagnostics/asp0013
ASP0013: Suggest switching from using Configure methods to WebApplicationBuilder.Configuration | Microsoft Learn
| - |
Value |
| Rule ID |
ASP0013 |
| Category |
Usage |
| Fix is breaking or non-breaking |
Non-breaking |
Cause
Configure isn't the recommended strategy for reading and writing to configuration in a Minimal API app. Configure was designed to be used with Web Host or .NET Generic Host. In a Minimal API app, WebApplicationBuilder.Configuration should be used to modify configuration directly.
Rule description
Configure isn't the recommended strategy for configuring logging in a Minimal API app.
var builder = WebApplication.CreateBuilder(args);
builder.Host.ConfigureAppConfiguration(builder =>
{
builder.AddJsonFile("customAppSettings.json");
})
var app = builder.Build();
app.Run();
How to fix violations
To fix a violation of this rule, use WebApplicationBuilder.Configuration to modify application configuration directly without the need for an additional ConfigureAppConfiguration call.
var builder = WebApplication.CreateBuilder(args);
builder.Configuration.AddJsonFile("customAppSettings.json");
var app = builder.Build();
app.Run();
When to suppress warnings
Do not suppress a warning from this rule.
JetBrains Rider gave me this:
https://learn.microsoft.com/aspnet/core/diagnostics/asp0013
ASP0013: Suggest switching from using Configure methods to WebApplicationBuilder.Configuration | Microsoft Learn
Cause
Configure isn't the recommended strategy for reading and writing to configuration in a Minimal API app.
Configurewas designed to be used with Web Host or .NET Generic Host. In a Minimal API app, WebApplicationBuilder.Configuration should be used to modify configuration directly.Rule description
Configureisn't the recommended strategy for configuring logging in a Minimal API app.How to fix violations
To fix a violation of this rule, use WebApplicationBuilder.Configuration to modify application configuration directly without the need for an additional ConfigureAppConfiguration call.
When to suppress warnings
Do not suppress a warning from this rule.