简体   繁体   中英

VS2010 Multi Project Templates

trying to create a multiproject template. I have three projects in a multiproject template:

<VSTemplate Version="3.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="ProjectGroup">
  <TemplateData>
    <Name>ScratchPad Multiproject Template</Name>
    <Description>ScratchPad for quick C# development</Description>
    <ProjectType>CSharp</ProjectType>
    <ProjectSubType>
    </ProjectSubType>
    <Icon>__Icon.ico</Icon>
    <SortOrder>1000</SortOrder>
    <CreateNewFolder>true</CreateNewFolder>
    <DefaultName>ScratchPad</DefaultName>
    <ProvideDefaultName>true</ProvideDefaultName>
    <LocationField>Enabled</LocationField>
    <EnableLocationBrowseButton>true</EnableLocationBrowseButton>
  </TemplateData>
  <TemplateContent>
    <ProjectCollection>
      <ProjectTemplateLink ProjectName="ScratchPad.ConsoleHost">ScratchPad.ConsoleHost\ScratchPad.ConsoleHost.csproj</ProjectTemplateLink>
      <ProjectTemplateLink ProjectName="ScratchPad.Lib">ScratchPad.Lib\ScratchPad.Lib.csproj</ProjectTemplateLink>
      <ProjectTemplateLink ProjectName="ScratchPad.Test">ScratchPad.Test\ScratchPad.Test.csproj</ProjectTemplateLink>  
    </ProjectCollection>
  </TemplateContent>
</VSTemplate>

Then I make a zip file that consists of the above template, icon file and an unzipped folder for each individual project template. This zip I copy to ..\\Visual Studio 2010\\Templates\\ProjectTemplates

All is well until I actually use the template with "New Project..." command. Then after I've selected the template and VS has asked me the target folder, it outputs following error:

在此处输入图片说明

If I see that project in the appdata folder, it's fine, it opens ok. Any ideas?

pom

Found my mistake. In the templatecontent section one should not reference the csproj files but vstemplate files.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM