VS 2013 Ultimate: Add new Elements, Windows Form m

2019-09-20 18:35发布

When creating a new project I can select a new Windows Forms Project. It will open me a new project with a new windows form. When right clicking my opened project and going for add => Windows Form it will only open the "new element" mask, where Windows Forms, WPF and other templates are missing.

I already tried Visual Studio C# Can't make new windows form project devenv /installvstemplates, but it didn't work out telling me the templates were missing.

The following files were passed with the commandline:
\installvtemplates
These files were not found and could not be load.

Error when using devenv /installvstemplates

What do I have to do, to get my WinForm templates back and where can I configure those? I can not just reinstall Visual Studio 2013 Ultimate, because I do not have an installation medium nor they key (Like nobody in my company can tell where to find it).


In the screenshot below you can see the mask, where I used to have a lot more templates. In this case we only have Inherited Forms and Inherited User Control as avaliable templates.

Windows Forms and other templates are missing

This is what I get when I go for new project, Windows Forms is avaliable here.

( Win Forms Objects not avaliable )


The template files are avaliable at C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\ItemTemplates\VisualBasic so I am pretty sure it has to be an option somewhere in the settings. Any ideas?

1条回答
爷、活的狠高调
2楼-- · 2019-09-20 18:50

After a few hours of trying I found a solution myself. It might not be the official way, but it seems to be working. I did the following steps:

  1. Go to C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\ItemTemplates\VisualBasic and check if the templates are avaliable
  2. If they are avaliable copy the directory Windows Forms
  3. Paste the copied directory to C:\Users\%USERNAME%\Documents\Visual Studio 2013\Templates\ItemTemplates\Visual Basic
  4. Start Visual Studio
  5. Go into a project and try to add a new element. This step will take a while loading. I think visual studio now detects the new templates in your documents folder and refreshes all templates.
  6. When it has finished loading you will see almost all templates twice. That's good news!
  7. Close Visual Studio and delete the directory in C:\Users\%USERNAME%\Documents\Visual Studio 2013\Templates\ItemTemplates\Visual Basic\ we just pasted.
  8. Restart Visual Studio
  9. Profit

Tested on Windows 10 / Visual Studio 2013 Ultimate

查看更多
登录 后发表回答