I am currently upgrading a .NET Core 3.1(LTS) MVC website to run on .NET 6, stepping it through intermediate .NET versions to make sure some EF Migrations were done correctly.

Everything upgraded without any major issue until the final step to .NET 6. As soon as I did this my MVC pages failed to render, but no error was reported

After much fiddling the solution to the problem was pointed out to me by one of my colleagues. The way MVC is shipped with .NET (Core) has changed from being a NuGet package to being part of the framework. This happened a good while ago, but become a blocking issue with .NET Core.

The fix was in the end simple, to remove the NuGet package references to the Microsoft.AspNetCore.* 2.2.0. Once this was done the unedited MVC pages loaded using the previous working methods. I did do some further tidying to use the current MVC controller methods, but this was not essential as the old methods are now just alias for the new methods.

So the lesson learnt?

Pay more attention to the various ‘Migrate from version of .NET Core to a later version steps’ documents, and don’t put off making changes for soon to be deprecated features, as it will trip you up in a confusing manner later.