dotnet / dotnet/aspnetcore

DeveloperExceptionMiddleware shouldn't have dependencies to `ProblemDetails`

Open
#46,339 4 comments 0 reactions 0 assignees View on GitHub
area-middleware area-minimal feature-problem-details
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 5h
Merged PRs (30d)
276

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Describe the bug

In https://github.com/dotnet/aspnetcore/issues/42212 was introduced the `IProblemDetailsService` and the `DeveloperExceptionPageMiddleware` updated to include `ProblemDetails` payload generation.

However, it introduced an unnecessary dependency to `JsonOptions` and `ProblemDetails` that could have been avoided if the the `ProblemDetails` generation was implemented using an `IDeveloperPageExceptionFilter`.

### Expected Behavior

`DeveloperExceptionPageMiddleware` should not have dependencies to `JsonOptions` or `ProblemDetails` but should have the `ProblemDetails` payload generated when `AddProblemDetails` is called.

### .NET Version

.NET 7

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.