My visual studio templates dialog box is empty. i

2019-07-31 03:04发布

In visual studio 2008, when you want to add a new form to a winForms application, you right lick your project or project subfolder, then point to Add, then click New Item and then select the type of item you want to add. (New windows From, New Class, TextFile, Xml File, ...,).

Now in my projects, the Add New Item dialogue is completely empty, so i can't add any thing to my project. The Project still compiles without any errors. This just happened suddenly.

Am not sure what i might have done wrong.

2条回答
我想做一个坏孩纸
2楼-- · 2019-07-31 03:25

I discovered that the ItemTemplates dialog was empty, when I not was in the root-node of my Solution Explorer.

  • Mark the solution root top (in the top)
  • Menu / File / New / File

It now shoes alle ItemTemplates.

查看更多
Juvenile、少年°
3楼-- · 2019-07-31 03:32

The command "devenv /resetsettings" from VS command prompt will restore Visual Studio back to its original factory state. To restore templates use command "devenv /installvstemplates"

What you can also try:

Under Tools => Options => Projects and Solutions, you can specify the directories for the project and item templates, maybe these got messed up and point to incorrect directories?

On my machine these are set to:

%userprofile%\My Documents\Visual Studio 2005\Templates\ProjectTemplates %userprofile%\My Documents\Visual Studio 2005\Templates\ItemTemplates

You need to replace the %userprofile% with the actual value (Eg: C:\Documents and Settings\Gabriel)

Notice that all your project templates and item templates

(

located in C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\ProjectTemplates

and in C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\ItemsTemplates

)

are zip files located under a subdir for the kind of item or project and then under a subdir for the language specification (1033 for English).

If it is missing, copy from other machine and place it.

查看更多
登录 后发表回答