Missing Project/Item Templates

2019-01-11 20:05发布

问题:

I have Visual Studio 2010 and recently both at home and at work have had an issue with missing projects in the Installed Templates. All that projects and the folder called 'Data' is missing So now SQLDatabase, DataSet, AdoNet Entity Data Model, LinqToSQL, XMLFile, etc...

Fixes tried so far:

  1. uninstall some recent framework addon or related products and it comes back.
  2. The most common fix is to do 'devenv /installvstemplates' command which has not worked for me.
  3. check for zip file in C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ProjectTemplates\CSharp\Data\1033 folder and is contains all the appropriate zip files. Also the same for ItemTemplates folder.
  4. Reinstall - Tried this 3 times no luck even went as far as to remove all reg keys and every folder that had anything to do with VS2010.
  5. All complete reset of all VS2010 settings and other related commands.

I'm at a lose at what to do next. Beside a complete OS re-install which seems a little drastic. Anyone have a better solution please?

回答1:

Run devenv.exe /installvstemplates with elevated privileges



回答2:

Make sure the .NET version at top of template list matches your solution's .NET version



回答3:

I had the same problem, but with the C#code item templates, and I fixed it with the following:

Tools/Options/Environment/International Settings/Language:
                              "Same as Windows" instead of "English"

and then restart VS2010.



回答4:

I've just run into this issue and resolved it by doing the following:

  1. I got the following folder and its contents from a colleague's PC \Common7\IDE\ProjectTemplates\CSharp.
  2. Then I copied it to the appropriate location on my PC (C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\ProjectTemplates\CSharp)
  3. I ran the command given in the answers above devenv.exe /installvstemplates using the Visual Studio Command Prompt tool with Administrator priviledges.