-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Breaking routing behavior between net6, net7 and net8. #50773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This seems to be related to the interactions with the implicit registrations and the middleware defined on the pipeline. For what its worth If you have a lot of customization in the pipeline, you might want to use the |
I added an additional test in my repro where I don't set up Code that used to work without any problems in .NET6 got worse in .NET7 and even more worse in .NET8. If this is intentional, it's a surprising behavior. |
This little adventure started some weeks ago as we were updating our applications from .NET6 to .NET7. We have over 150 internal apps running on .NET, so we have an internal framework that handles all the common things: complete control over the middleware pipeline being one of them.
Our framework for .NET6 was still using Startup since we needed to support old .NET Framework applications as well. For .NET7, we removed .NET Framework and moved over to minimal API's setup since that is where all the cool kids are these days. During this update we discovered a routing change that was reported as #50393, but we managed to find a workaround.
With the release on .NET8 RC1, we started updating our framework to support that, and came across the same error we had on .NET7.
The core of the problem is that if we use static files, UsePathBase and Razor pages with a match-all filter, then we never get static files. We always get the default Razor page.
I've been trying different things, and it just gets even more confusing. My main branch is running .NET7 and works with the workaround. I created a new branch where we multi-target .NET7 and .NET8; selecting .NET7 as the target framework and the code stops working.
One of the selling points for minimal api's was to move away from the ceremony and magic of MVC. Debugging this new minimal api magic isn't that much easier.
I've updated my repro with some tests that illustrate things: https://github.com/kimbell/RazorStatics
For .NET6, all tests are green
For .NET7, static file tests only work with our workaround
For .NET8, no static file tests work.
The text was updated successfully, but these errors were encountered: