locked
Multi-Target Project Template - How to get the child projects to rename RRS feed

  • Question

  • Hello,

    I'm trying to follow this MSDN article. http://msdn.microsoft.com/en-us/library/ms185308.aspx

    I'm creating a WCF solution with 8 projects in it to use as a ProjectTemplate.

    The problem I'm having is figuring out how to get child projects to take on the name I use when I create a new solution for the template.

    For example, I have a WCFSolution.BLL project in the Project Template I've created.

    My root template is called WCFSolution.vsTemplate

    <VSTemplate Version="2.0.0" Type="ProjectGroup"
    
     xmlns="http://schemas.microsoft.com/developer/vstemplate/2005">
    
     <TemplateData>
    
     <Name>WCFSolution</Name>
    
     <Description>WCF multi-project solution</Description>
    
     <Icon>Icon.ico</Icon>
    
     <ProjectType>CSharp</ProjectType>
    
     </TemplateData>
    
     <TemplateContent>
    
     <ProjectCollection>
    
      <ProjectTemplateLink ProjectName="WCFSolution.BLL">
    
      WCFSolution.BLL\MyTemplate.vstemplate
    
      </ProjectTemplateLink>
    
      <ProjectTemplateLink ProjectName="DALTemplate">
    
      DAL\MyTemplate.vstemplate
    
      </ProjectTemplateLink>
    
      <ProjectTemplateLink ProjectName="DataContractsTemplate">
    
      DataContracts\MyTemplate.vstemplate
    
      </ProjectTemplateLink>
    
      <ProjectTemplateLink ProjectName="MessageContractsTemplate">
    
      MessageContracts\MyTemplate.vstemplate
    
      </ProjectTemplateLink>
    
      <ProjectTemplateLink ProjectName="ProviderContractsTemplate">
    
      ProviderContracts\MyTemplate.vstemplate
    
      </ProjectTemplateLink>
    
      <ProjectTemplateLink ProjectName="WebSvcTemplate">
    
      WebSvc\MyTemplate.vstemplate
    
      </ProjectTemplateLink>
    
      <ProjectTemplateLink ProjectName="ServiceContractsTemplate">
    
      ServiceContracts\MyTemplate.vstemplate
    
      </ProjectTemplateLink>
    
      <ProjectTemplateLink ProjectName="ServiceImplementationTemplate">
    
      ServiceImplementation\MyTemplate.vstemplate
    
      </ProjectTemplateLink>
    
     </ProjectCollection>
    
     </TemplateContent>
    
    </VSTemplate>
    
    

    I go into Visual Studio after adding the Template and I want to create a new solution.  If I name the new solution NST

    I want WCFSolution.BLL to become NST.BLL.

    I've expermented with the $ $ parameters but no luck.

    So the question is how do you create a Multi-Target Project Template so that when you use the template to add a new Solution, whatever you name the solution gets used as a prefix in your Templates project names.

    Obviously I want each projects Namespace to reflect this as well.

    Now if I create a single Project and call is say WCFSolution.BLL and export it.

    Then if I import it and create a new solution and use the this template which is a single project, if I name the solution NST, then the project gets created as NST.BLL like I want.

    However, I'm just not having any luck in the multi-target scenario.

    Thanks.


    kfrost
    Monday, February 28, 2011 12:50 AM

Answers

All replies