I\'m following a video tutorial where I\'m required to create an empty ASP.NET Web
Application with MVC
, using Visual Studio 2015
, bei
A simple VS restart worked for me. I just closed VS and restarted.
Try clearing the ComponentModelCache, the cache will rebuild next time VS is launched.
[your users name]
\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache14.0 is for visual studio 2015. This will work for other versions also.
Deleting the .vs folder inside the solution directory worked for me.
I know this is a really old thread, but I came across it whilst working on my issue. Mine was caused because I had renamed one of my Model classes. Even though the app built and ran fine, when I tried to add a new controller I got the same error. For me, I just deleted the class I had renamed, added it back in and all was fine.
In ASP.NET Core check if you have the Microsoft.VisualStudio.Web.CodeGeneration.Tools
nuget package and it corresponds to your project version.
Follow these steps to add a view in a different way than the typical way:
If you cannot open the view that you are created, simply right click on the view file, choose Open with, and select HTML (web forms) editor then okay.