The following error occurs when creating a new ASP.NET Core MVC project or loading old projects in .NET 7:

All the archovios are created and in the right place.

The error persists even if you manually change the route

I have searched everywhere and have not been able to find the problem.
1- Go to your project solution -->Right click and add Nuget Packages called
*Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation* install this.
2- Add one line on Program.cs file
i.e builder.Services.AddControllersWithViews()***.AddRazorRuntimeCompilation()***;
For anyone having this issue when updating to Visual Studio 2022 17.7.7, updating to 17.8 solved it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With