Saturday, January 19, 2013

Restore missing Item templates in Visual Studio 2012

I’m working on a large Silverlight to WPF project migration and came across a issue where item templates where not being displayed from the Add new Items dialog. After a bit of searching it became apparent that this was a fairly common problem and there are a number of ways to fix the issue. Of the the various suggestions I found one seemed to work the best, although it was originally for Visual Studio 2010. So here is how you can get those missing templates back.

  • Navigate to C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE
  • Delete the ItemTemplatesCache folder
  • In the ItemsTemplate folder navigate to the templates you want to display and for each template open the vstemplate file in a text editor and set ShowByDefault from false to true
  • run devenv /installvstemplates

You may need to run this as an administrator. Once this is done open your project in Visual Studio and right click “Add New Item” your templates should now appear.

1 comment:

Anonymous said...

Finally I found out myself... Unfortunately Google finds your blog only when you already know the solution. Thank you, though. Without setting that flag (as others advice), running devenv /installvstemplates is quite useless.

Wonder why that flag exists as there seems to be no way to display those templates that have the flags set false -.-