سؤال

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