visual studio has encountered an exception .this may be caused by an extension.

It seems this error was due to extension. What's your Visual Studio version?

Could you please disable or remove all of your extensions? 

After that, please follow some common steps to reinstall templates:

1)Please open Windows Explorer, and navigate to  <Visual Studio Installation Path>\Common7\IDE (by default is C:\Program Files \Microsoft Visual Studio 10.0\Common7\IDE); 
2)Delete the ItemTemplatesCache, ProjectTemplatesCache folder; (If you are using VWDExpress, please delete folder under \Common7\IDE\VWDExpress)
3)Open Visual Studio Command Prompt (2010) under Start menu -> All Programs -> Microsoft Visual Studio 2010 -> Visual Studio Tools (run it with Administrator privilege: right-click the program -> Run as administrator); 
4)Run the devenv /InstallVSTemplates switch; (VWDExpress if you are using it)
5)Run the devenv /Setup switch

http://social.msdn.microsoft.com/Forums/en-US/netfxsetup/thread/9b5455c6-a9c6-4c18-90ca-51311411346c/

原文地址:https://www.cnblogs.com/loongfee/p/2845809.html