I am trying to create some simple element templates for Visual Studio 2013 (Professional) projects in C ++, but Visual Studio seems to be struggling with me. I started using the File -> Export Template... wizard, which completed and created the zip file, but, alas, the new template was not shown anywhere in the Add New Item dialog box, so I started to manually edit it to check if I can 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 tried to use both VC and VisualC for <ProjectType> and place the template in different folders in both zipped and extended forms.
After changing <ProjectType> to CSharp and creating a C # project, it will appear immediately. Interestingly, if the %USERPROFILE%\Documents\Visual Studio 2013\Templates\ItemTemplates\Visual C# directory is empty, the template will be displayed if it is in the %USERPROFILE%\Documents\Visual Studio 2013\Templates\ItemTemplates or %USERPROFILE%\Documents\Visual Studio 2013\Templates\ItemTemplates\Visual C++ Project , but if its copy is also in the Visual C# directory, it is displayed twice in the dialog of the new element ...
I know that there was an error with Visual Studio 2013 Express RC, where in the New Element dialog there were no templates at all, even built-in ones, so I think this could be an error in Visual Studio, or just another example Microsoft violates C ++ neglect.
Is there something I am missing here or is this a bug with VS2013? If anyone knows of a workaround?
Edit: This problem still exists in Visual Studio 2015 RC
c ++ visual-c ++ visual-studio visual-studio-2013 visual-studio-2015
bcrist
source share