I'm following a video tutorial where I'm required to create an empty ASP.NET Web
Application with MVC
, using Visual Studio 2015
, being new to ASP.NET world, I'm following step by step.
I got my project created well, next step adding a View from an existing Controller
, I got hit by a messagebox error saying :
Error :
There was an error running the selected code generator: 'Invalid pointer (Exception from HRESULT:0x80004003(E_POINTER))'
I Googled the problem, found similar issues, but none leaded to a clear solution, some similar problems where issued by anterior version of VisualStudio, but as I said none with a clear solution.
To clarify what I experienced, here's what I've done step by step :
Chosen a ASP.NET Web Application :
Chosen Empty Template with MVC checked :
Tried to Add View
from a Controller :
Some settings ...
The Error :
What's causing this problem and What is the solution for it ?
Update :
It turns out that even by trying to add the View manually I get the same error, adding a view is all ways impossible !
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.
This didn't work for me. Neither did any of the other solutions listed in any of the other answers to this question.
This worked for me, though my error was different. I want to Kiss somebody. I was stuck with the trying to work around it for quite some time.
A simple restart of VS 2017 did it for me
path for me C:\Users\<userName>\AppData\Local\Microsoft\VisualStudio\15.0_eed87ff6\ComponentModelCache
I did this in 2019 and the "Add View" item is gone from the menu completely, I only have "Add MVC 5 view" now (which I don't use, I'm on 4)