This code will help you to understand how to solve the issue the type or namespace name ‘Mvc’ does not exist in the namespace ‘Microsoft.AspnetCore’.
While upgrading Blazor applications, you many encounter these issues. You have to do the following changes to properly run the application:
// Replace this: app.UseMvc(routes => { routes.MapRoute(name: "default", template: "{controller}/{action}/{id?}"); }); // With this: app.UseRouting(); app.UseEndpoints(routes => { routes.MapDefaultControllerRoute(); });
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
While upgrading Blazor applications, you many encounter these issues. You have to do the following changes to properly run the application:
-
- Run dotnet clean on the solution to clear out old Razor declarations.
need an explanation for this answer? contact us directly to get an explanation for this answer