IActionInvokerProvider & UseStatusCodePagesWithReExecute 3.1 to net 6 difference
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 281
Description
### Is there an existing issue for this?
- [X] I have searched the existing issues
### Describe the bug
Context:
Upgrading an existing aspnet application from core 3.1 to dotnet 6.0.
Issue: We have registered a IActionInvokerProvider in our web app. This simply adds some information to the context route data. We also use UseStatusCodePagesWithReExecute
app.UseStatusCodePagesWithReExecute("/ErrorStatus", "?statusCode={0}");
According to the documentation https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.abstractions.iactioninvoker?view=aspnetcore-3.1
An IActionInvoker is created for each request the MVC handles by querying the set of IActionInvokerProvider instances. See IActionInvokerProvider for more information.
When running this in netcoreapp3.1 when we return a NotFound() I can observe that 2 calls are made to our action provider OnProvidersExecuting. One for the request to the resource and one for a call expected UseStatusCodePagesWithReExecute to /somecontroller.
When targeting net6.0 and changing no other code this second call to /somecontroller does not get called only the first . If I call the endpoint /ErrorStatus?statusCode=404 I it does trigger the invoker. I cannot find a reference to a breaking change anywhere. perhaps I missed it.
Does anyone know what the casue might be?
I have tried altering the ordering of the pipeline to no avail
### Expected Behavior
No change in behaviour without documentation to indicate. (There might be might have missed it)
### Steps To Reproduce
I tried creating a minimal recreation. In the version the Action provider never gets called at all
https://github.com/csi-lund/core31tonet6issue
### Exceptions (if any)
None
### .NET Version
6.0.400
### Anything else?
3.1

Thank in advance.
Contributor guide
Assessment
This issue has not been assessed yet.