locked
Multiple Project Creation Template RRS feed

  • Question

  • I want to add several 'C# Class Library' projects (in one hit) to a particular 'Solution Folder' when the user chooses the Add submenu on the solution Folder

    I have setup a UnboundTemplateReference to provide the command to the Solution Folder's Add Menu - that's appears fine.

    I have created a ProjectGroup template as follows.

    When I click the menu command, it displays the File | New Project dialog box, where I have to manually select my template.

    I'd like to skip the dialog and go right to displaying my recipie to get the name of the project Group etc.

    Is this possible?

    <VSTemplate

    Version="2.0"

    Type="ProjectGroup"

    xmlns="http://schemas.microsoft.com/developer/vstemplate/2005">

    <TemplateData>

    <Name>Subsystem Projects</Name>

    <Description>Projects for a subsystem</Description>

    <ProjectType>General</ProjectType>

    <SortOrder>90</SortOrder>

    <Icon>LOBSolution.ico</Icon>

    <CreateNewFolder>false</CreateNewFolder>

    <DefaultName>Subsystem</DefaultName>

    <ProvideDefaultName>true</ProvideDefaultName>

    </TemplateData>

    <TemplateContent>

    <ProjectCollection>

    <ProjectTemplateLink ProjectName="Access.Data">Access.Data\Access.Data.vstemplate</ProjectTemplateLink>

    </ProjectCollection>

    </TemplateContent>

    <WizardExtension>

    <Assembly>Microsoft.Practices.RecipeFramework.VisualStudio, Version=1.0.50505.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</Assembly>

    <FullClassName>Microsoft.Practices.RecipeFramework.VisualStudio.Templates.UnfoldTemplate</FullClassName>

    </WizardExtension>

    <WizardData>

    <Template xmlns="http://schemas.microsoft.com/pag/igt-template"

    SchemaVersion="1.0"

    Recipe="AddSolutionSubsystem">

    </Template>

    </WizardData>

    </VSTemplate>

    Monday, October 31, 2005 8:28 PM

Answers

  • Nope, you can't, and it's by design. In Visual Studio, unfolding project and item templates is an operation that always happens from the Add New dialog, and the VS team insisted that we should keep that experience consistent.
    Wednesday, November 2, 2005 4:39 AM
    Moderator

All replies

  • Nope, you can't, and it's by design. In Visual Studio, unfolding project and item templates is an operation that always happens from the Add New dialog, and the VS team insisted that we should keep that experience consistent.
    Wednesday, November 2, 2005 4:39 AM
    Moderator
  • OK,
    Then is it possible to put the user in the right place in the File | New Project dialog?
    At present they have to know to navigate to the 'Guidance Packages' category and select the sub category for my package and select the right template.
    I would prefer if I could navigate them there and auto select it for them, and let them at least rename for the project name.

    Without this, the linkage is lost. The developer is not going to expect to have to find the template manually.

    I thought that the <ProjectType> node of the template controlled this, but what value do I need here to get them in the right place?
    Wednesday, November 2, 2005 3:46 PM