質問

My multiproject vstemplate looks as below

<TemplateContent>   
    <ProjectCollection>
<SolutionFolder Name="samplefolder">
      <ProjectTemplateLink ProjectName="$safeprojectname$.projectone">            
                sample.projectone\MyTemplate.vstemplate
            </ProjectTemplateLink>
            <ProjectTemplateLink ProjectName="$safeprojectname$.projecttwo">
                sample.projecttwo\MyTemplate.vstemplate
            </ProjectTemplateLink> 
    <ProjectTemplateLink ProjectName="$safeprojectname$.projectthree">
                sample.projectthree\MyTemplate.vstemplate
            </ProjectTemplateLink>
</SolutionFolder>
    </ProjectCollection> 
</TemplateContent> 

Problem is I need to have the solutonfolder name to be same as the the projectname entered by user. If I give $safeprojectname$' in the place of "samplefolder" the solution folder name is not being replaced.

役に立ちましたか?

解決 2

The above answer was not the perfect one as it doesn't work when the project is created under nested folders.

This is solved by giving a guid as solution folder name in the multiproject template and then looping through the projects in the solution to find the guid and rename the solution folder with the project name.

Posted the code here

他のヒント

Got the solution based on this post

How to change containing folder name for a project in VS 2010 template

by handling it in wizard. Created solution folder, removed the projects from solution and added to the solution folder.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top