Visual Studio 2013/2015 C ++项目模板丢失 [英] Visual Studio 2013/2015 C++ Item Templates Missing
问题描述
我正在尝试为Visual Studio 2013(专业)C ++项目制作一些简单的项目模板,但是Visual Studio似乎正在与我作战.我开始使用File -> Export Template...
向导,该向导完成并生成了一个zip文件,但是,可惜,在Add New Item
对话框中找不到新模板,因此我开始手动编辑它以查看是否可以修复它./p>
这是我的测试.vstemplate
文件:
<VSTemplate Version="3.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="Item">
<TemplateData>
<DefaultName>test</DefaultName>
<Name>Test</Name>
<Description>Test item template.</Description>
<ProjectType>VC</ProjectType>
<!--<SortOrder>10</SortOrder>-->
<Icon>icon.ico</Icon>
</TemplateData>
<TemplateContent>
<ProjectItem TargetFileName="$fileinputname$.h" ReplaceParameters="true">test.h</ProjectItem>
</TemplateContent>
</VSTemplate>
我尝试将VC
和VisualC
都用于<ProjectType>
,并将模板以压缩和扩展形式放置在各种文件夹中.
将<ProjectType>
更改为CSharp
并创建C#项目后,它将立即显示.有趣的是,如果%USERPROFILE%\Documents\Visual Studio 2013\Templates\ItemTemplates\Visual C#
目录为空,则该模板现在将显示在%USERPROFILE%\Documents\Visual Studio 2013\Templates\ItemTemplates
或%USERPROFILE%\Documents\Visual Studio 2013\Templates\ItemTemplates\Visual C++ Project
目录中,但是如果该模板的副本也位于Visual C#
目录中,则该模板将显示两次.新项目对话框...
我知道Visual Studio 2013 Express RC中存在一个错误,其中新项"对话框根本不会显示任何模板,即使是内置模板也是如此,因此我认为这可能是Visual Studio中的错误. ,或者是Microsoft令人不屑地无视C ++的另一个示例.
这里是否缺少我的东西,或者这是VS2013的错误?如果是这样,有人知道任何解决方法吗?
此问题在Visual Studio 2015 RC中仍然存在
存在相同的问题.对我有效的解决方法是使用VS2013 Express版本,在该版本中C ++ Item模板可以正常工作(就像在VS2012 Pro/Express中一样).我不知道为什么该便捷功能已从Pro版本中删除,但仍可以在免费快速版中继续使用.
I am trying to make some simple Item Templates for Visual Studio 2013 (Professional) C++ projects, but Visual Studio seems to be fighting with me. I started using the File -> Export Template...
wizard, which completed and generated a zip file, but alas, the new template was nowhere to be seen on the Add New Item
dialog, so I started manually editing it to see if I could fix it.
Here is my test .vstemplate
file:
<VSTemplate Version="3.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="Item">
<TemplateData>
<DefaultName>test</DefaultName>
<Name>Test</Name>
<Description>Test item template.</Description>
<ProjectType>VC</ProjectType>
<!--<SortOrder>10</SortOrder>-->
<Icon>icon.ico</Icon>
</TemplateData>
<TemplateContent>
<ProjectItem TargetFileName="$fileinputname$.h" ReplaceParameters="true">test.h</ProjectItem>
</TemplateContent>
</VSTemplate>
I've tried using both VC
and VisualC
for <ProjectType>
and placing the template in various folders, in both zipped and expanded forms.
After changing <ProjectType>
to CSharp
and creating a C# project it shows up immediately. Interestingly, if the %USERPROFILE%\Documents\Visual Studio 2013\Templates\ItemTemplates\Visual C#
directory is empty, the template will now show up if it is in %USERPROFILE%\Documents\Visual Studio 2013\Templates\ItemTemplates
or %USERPROFILE%\Documents\Visual Studio 2013\Templates\ItemTemplates\Visual C++ Project
directories, but if a copy of it is also in the Visual C#
directory it shows up twice in the new item dialog...
I know there was a bug with the Visual Studio 2013 Express RC where the New Item dialog wouldn't show any templates at all, even the built-in ones, so I'm thinking this might be a bug in Visual Studio, or just another example of Microsoft's disturbing disregard for C++.
Is there something I'm missing here or is this a bug with VS2013? If so does anyone know of any workaround?
Edit: This problem still exists in Visual Studio 2015 RC
Having the same problem. The workaround that works for me is to use the VS2013 Express edition, where C++ Item templates work just fine (just like they did in VS2012 Pro/Express). I have no clue why this handy functionality has been removed from the Pro edition but keeps on working in the free express edition.
这篇关于Visual Studio 2013/2015 C ++项目模板丢失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!