Item Template for VSTemplate file

1

I'm trying to create VS Item Template that will allow adding .vstemplate files to project.

This is how my vsTemplate.vstemplate file currently looks:

<?xml version="1.0" encoding="utf-8"?>
<VSTemplate
 xmlns:sdk="http://schemas.microsoft.com/developer/vstemplate-sdkextension/2010"
 xmlns="http://schemas.microsoft.com/developer/vstemplate/2005"
 Version="3.0.0"
 Type="Item">
    <TemplateData>
        <Name>VS Item Template</Name>
        <Icon>vsTemplate.ico</Icon>
        <Description>VS Item Template Files</Description>
        <DefaultName>vsTemplate</DefaultName>
        <ProjectType>CSharp</ProjectType>
        <TemplateID>Microsoft.CSharp.Class</TemplateID>
        <CreateInPlace>true</CreateInPlace>
    </TemplateData>
    <TemplateContent>
        <ProjectItem TargetFileName="Template\$fileinputname$.vstemplate" ReplaceParameters="true">vsTemplate.data</ProjectItem>
        <ProjectItem TargetFileName="Template\$fileinputname$.$fileinputextension$.data">vsTemplate.empty.data</ProjectItem>
        <ProjectItem TargetFileName="Template\$fileinputname$.ico">vsTemplate.ico.data</ProjectItem>
    </TemplateContent>
</VSTemplate>

When I am trying to use it (inside vs experimental instance), I am getting this error:

The system cannot find the file specified. (Exception from HRESULT: 0x80070002)

How I understand the problem, I need to specify custom build action for .vstemplate file inside .csproj file, something like this:

<VSTemplate Include"..."/>

But I don't know how to do that.

What I'am already tried:

  • set ItemType="VSTemplate" for vstemplate ProjectItem
  • use custom Wizard class
  • add /log option inside project command line argument window (it does not provide any additional information)
templates
visual-studio-templates
asked on Stack Overflow Aug 17, 2018 by Zamaleev Timur

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0