4

i'm working with asp.net mvc with visual studio community 2015. i need to create new View with name "aaaaaa" but when i try to create new controller and add new view, i have an error

error was an error running the selected code generator:invalid pointer(Exception from HRESULT:0x80004003(E_POINTER))

enter image description here

can some one tell me what happen? and how i can fix this issue?

novian kristianto
  • 751
  • 3
  • 12
  • 34
  • MVC will look for a view under Views/Home called aaaa.cshtml. Is the view there? To get around the issue create the view manually. – Greg Dec 21 '15 at 15:34
  • If you don't have any other extensions installed, I would recommend filing an issue at http://www.github.com/aspnet/Home. It looks like a tooling issue. – Maxime Rouiller Dec 21 '15 at 15:35
  • @Greg error is not about the view, but visual studio cannot scaffold to create new view – novian kristianto Dec 21 '15 at 15:38
  • I see - then I agree with Maxime, but in the meantime, just create it manually to bypass the scaffolding. – Greg Dec 21 '15 at 15:41
  • any solution to this problem, I have the same issue on Visual Studio 2015 – AymenDaoudi Jan 25 '16 at 13:39

2 Answers2

2

For me this error began to appear after installing Web Essentials (a Visual Studio extension). I tried to repair the installation, but the error remained even after that. So I tried the following command (no need for administrative privileges) after closing all instances of Visual Studio that were currently running:

devenv.exe /resetuserdata

Here's the link to the Web Essentials version that broke my Visual Studio. At the time of this writing the current version was 1.0.198.

Zignd
  • 6,896
  • 12
  • 40
  • 62
  • This didn't help me. But it did reset my user data. Wild. – Matt Jan 19 '17 at 22:43
  • Good, it solved my problem however this command will restart the Visual studio and that means all the history of your projects cached in the project list will be removed.My recommendation is to use when it is necessary. We don't know what else it goes away after restrating the visual Studio . – Ahmed Elbatt Mar 10 '17 at 13:46
2

I also had this error. Plus I was also getting the error "object reference not set to an instance" when trying to open existing views.

I found the answer here: https://stackoverflow.com/a/35815094/5935995

I had to clear the ComponentModelCache by:

  1. Close Visual Studio
  2. Delete everything in this folder C:\Users\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache
  3. Restart Visual Studio
Community
  • 1
  • 1
kwilliams
  • 21
  • 1
  • 4