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
Background and Motivation
Registering a custom
IProblemDetailsWriterafter callingAddRazorPages, etc results in theDefaultProblemDetailsWriter, not the customIProblemDetailsWriterbeing called.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.cc @david-acker @mitchdenny @captainsafia
Moved to #48180