Visual Studio template not showing
Posted
by David
on Stack Overflow
See other posts from Stack Overflow
or by David
Published on 2010-06-11T14:46:39Z
Indexed on
2010/06/11
15:13 UTC
Read the original article
Hit count: 507
visual-studio
|templates
Hi all
I've followed this tutorial to try to add a template to Visual Studio:
http://www.switchonthecode.com/tutorials/visual-studio-how-to-create-item-templates
The template I have created is designed to add one predefined .aspx and one predefined .aspx.cs file to the project.
The folder contains the following files:
MoosePage.aspx
MoosePage.aspx.cs
MoosePage.vstemplate
MoosePageItemTemplateIcon.ico
The .vstemplate file looks like this:
<VSTemplate Type="Item" Version="2.0.0"
xmlns="http://schemas.microsoft.com/developer/vstemplate/2005">
<TemplateData>
<Name>MoosePage</Name>
<Description>MoosePage Template</Description>
<DefaultName>NewMoosePage</DefaultName>
<ProjectType>CSharp</ProjectType>
<Icon>MoosePageItemTemplateIcon.ico</Icon>
</TemplateData>
<TemplateContent>
<ProjectItem TargetFileName="$fileinputname$.aspx" ReplaceParameters="true">
MoosePage.aspx
</ProjectItem>
<ProjectItem TargetFileName="$fileinputname$.aspx.cs" ReplaceParameters="true">
MoosePage.aspx.cs
</ProjectItem>
</TemplateContent>
</VSTemplate>
I have zipped the files up (.zip not .zipx) and placed the zip folder in My Documents\Visual Studio 2008\Templates\ItemTemplates\VisualWebDeveloper.
I have restarted Visual Studio.
When I go into my website project and choose Add New Item, I don't see my new template.
Can anyone suggest what might have gone wrong?
Thanks
David
© Stack Overflow or respective owner