Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

0x80070002 error when creating new ASP.NET MVC 4 Web Application in VS2012

I'm trying to create a new ASP.NET MVC 4 Web Application, when this message pops up after selecting a project template (e.g. Empty) and pressing OK:

Error Message

I am running Windows 8 Professional with Visual Studio 2012 Professional.

So far I've tried a few minor things:

  • Running VS2012 as Administrator
  • Running devenv /setup from the Developer Command Prompt
  • Reinstalling Microsoft ASP.NET MVC 4 from http://www.asp.net/downloads
  • Running Repair fromt he VS2012 Installer
  • Installing Visual Studio 2012 Professional from scratch

None of the above steps has helped, so something is probably broken somewhere.

Has anyone experienced something similar to this before? Any ideas would be greatly appreciated.

Feel free to ask for more information, logs or whatnot if you require it :)

like image 771
Khereth Avatar asked Nov 24 '12 02:11

Khereth


2 Answers

That would work, but it's not the safest thing to do.

The MVC wizard is a shared component in VS, ie. There is one copy of the DLL that lives in Common7\IDE.

When you installed the 2012.2 update, and then installed another SKU altogether, you have the old templates from the new SKU with the new wizard. What you should do in this situation is the following:

  1. Install Express 2012
  2. Install Web Tools 2012.2 update (this drops the 4.1 templates)
  3. Install VS Pro 2012 (MVC templates will not work)
  4. To fix this, you need to go to Add/Remove Program and Repair "Microsoft ASP.NET Web Frameworks and Tools 2012.2". The repair operation will figure out that you are missing the updated MSIs for the VSPro SKU and install it for you.

Jacques

like image 200
Jacques Eloff Avatar answered Oct 28 '22 15:10

Jacques Eloff


From Jacques (who writes the installers):

Sounds like the files are missing from the project template cache.

If he has everything installed then he could try the following

  1. Shut down all instance of VS
  2. Delete the ProjectTemplatesCacheFolder from Program Files\Microsoft Visual Studio 11.0\Common7\IDE\ProjectTemplatesCache
  3. Launch the VS developer command prompt as administrator
  4. Run devenv /setup
  5. Confirm that the ProjectTemplateCache has been rebuilt

If the cache doesn’t rebuild then there is something more serious wrong on the system.

like image 32
Jon Galloway Avatar answered Oct 28 '22 14:10

Jon Galloway