warn about registering customer service /5#29221
Conversation
@mitchdenny @captainsafia What do you think about this? |
|
cc @david-acker |
| 2. Use a custom [`IProblemDetailsWriter`](#custom-iproblemdetailswriter) | ||
| 3. Call the [`IProblemDetailsService` in a middleware](#problem-details-from-middleware) | ||
|
|
||
| ***Note:*** When using a custom `IProblemDetailsWriter`, the custom `IProblemDetailsWriter` must be registered before calling <xref:Microsoft.Extensions.DependencyInjection.MvcServiceCollectionExtensions.AddRazorPages%2A>, <xref:Microsoft.Extensions.DependencyInjection.MvcServiceCollectionExtensions.AddControllers%2A>, or <xref:Microsoft.Extensions.DependencyInjection.MvcServiceCollectionExtensions.AddControllersWithViews%2A>. |
There was a problem hiding this comment.
What do you think about adding it under https://review.learn.microsoft.com/en-us/aspnet/core/fundamentals/error-handling?branch=pr-en-us-29221&view=aspnetcore-8.0#custom-iproblemdetailswriter, call out that it must be registered before AddProblemDetails as well and maybe add an example of registration?
|
It seems like adding an analyzer to detect this would be straightforward. The one for ASP0001 serves a similar purpose. |
@david-acker can you review |
|
dotnet/aspnetcore#48180 LGTM! When I get a chance, I'll take a look at the code for the ASP0001 analyzer and think of some suggestions based on that. |
|
@david-acker Thanks David! You rock! 🎸 |
* warn about registering customer service /5 * prob det * prob det
Fixes #29152
Bruno, can't we get an ASPnnnn code analysis to detect this?
Review URL internal only
Internal previews