Symptom: You cannot add a new project or an item in Visual Stuio IDE.
Problem: Open the Event Viewer (Control Panel->Administrative Tools->Event Viewer) and see if the suggestion says “Run devenv.exe /installvstemplates”. If this is the case, then the problem is the template files are missing.
Solution:
1. Close all instances of Microsoft Visual Studio.
2. There are two folders under IDE folder (C:\Program Files\Microsoft Visual Studio xx\Common7\IDE), namely ProjectsTemplateCache and ItemsTemplateCache. Delete these two folders. Yes, I said, delete. If you are hesitant, don’t worry, it will go to the recycle bin from where you can retrieve them.
3. After deleting the folders, open the command prompt and run this command: Devenv /InstallVSTemplates .
4. Done. The template files should be restored and you should be able to add new projects and items.
I found myself in this situation out of nowhere. I was innocently coding and debugging and when I tried adding a control to my project, I suddenly see this error message. Thank God, the solution was this simple. Imagine spending another 4 hours on reinstalling Visual Studio. I wonder why I got into this situation, in the first place. Any idea?