Skip to content

[Analyzer] : Warn when registering custom IProblemDetailsWriter after calling AddRazorPages, etc #48178

@Rick-Anderson

Description

@Rick-Anderson

Background and Motivation

Registering a custom IProblemDetailsWriter after calling AddRazorPages, etc results in the DefaultProblemDetailsWriter, not the custom IProblemDetailsWriter being called.

Analyzer Behavior and Message

Issue a warning when Registering a custom IProblemDetailsWriter after calling AddRazorPages, etc.

ASP0001: Authorization middleware is incorrectly configured is similar.

See dotnet/AspNetCore.Docs#29152

Note: When using a custom IProblemDetailsWriter, the custom IProblemDetailsWriter must be registered before calling AddRazorPages, AddControllers, or AddControllersWithViews.

cc @david-acker @mitchdenny @captainsafia

Moved to #48180

Metadata

Metadata

Assignees

No one assigned

    Labels

    analyzerIndicates an issue which is related to analyzer experienceapi-suggestionEarly API idea and discussion, it is NOT ready for implementationold-area-web-frameworks-do-not-use*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions