-
Notifications
You must be signed in to change notification settings - Fork 10.6k
[Analyzer] : Warn when registering custom IProblemDetailsWriter after calling AddRazorPages, etc #48180
Copy link
Copy link
Open
Labels
analyzerIndicates an issue which is related to analyzer experienceIndicates an issue which is related to analyzer experienceapi-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesbugThis issue describes a behavior which is not expected - a bug.This issue describes a behavior which is not expected - a bug.help wantedUp for grabs. We would accept a PR to help resolve this issueUp for grabs. We would accept a PR to help resolve this issue
Milestone
Metadata
Metadata
Assignees
Labels
analyzerIndicates an issue which is related to analyzer experienceIndicates an issue which is related to analyzer experienceapi-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesbugThis issue describes a behavior which is not expected - a bug.This issue describes a behavior which is not expected - a bug.help wantedUp for grabs. We would accept a PR to help resolve this issueUp for grabs. We would accept a PR to help resolve this issue
Type
Fields
Give feedbackNo fields configured for issues without a type.
Background and Motivation
Registering a custom
IProblemDetailsWriterafter callingAddRazorPages, etc results in theDefaultProblemDetailsWriter, not the customIProblemDetailsWriterbeing called.Proposed Analyzer
Analyzer Behavior and Message
Issue a warning when Registering a custom
IProblemDetailsWriterafter callingAddRazorPages, etc.ASP0001: Authorization middleware is incorrectly configured is similar.
See dotnet/AspNetCore.Docs#29152
Note: When using a custom
IProblemDetailsWriter, the customIProblemDetailsWritermust be registered before calling AddRazorPages, AddControllers, or AddControllersWithViews.Category
Severity Level
Usage Scenarios
Issue a warning when Registering a custom
IProblemDetailsWriterafter callingAddRazorPages, etc.Risks
None.