Share via


Defining Solution Templates

Retired Content

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies.
This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

A Solution template is a single-project or multi-project template that unfolds itself into new solutions. Solution templates are specific to the Guidance Automation Toolkit, and they have no direct equivalent in Visual Studio. Solution templates are visible in the New Project dialog box if they are located in the Solution templates root folder in the Guidance Package solution structure. Solution templates always start a new solution, and they always enable their Guidance Package, irrespective of whether a solution is already open. Solution templates can create bound references and execute recipes. The following XML code example shows a template that creates a template reference and executes the CreateSolution recipe.

<VSTemplate 
Version="2.0" 
Type="ProjectGroup"
xmlns="https://schemas.microsoft.com/developer/vstemplate/2005">
<TemplateData>
<Name> PackageName Sample Solution</Name>
<Description> PackageName Sample Solution </Description>
<ProjectType>CSharp</ProjectType>
<SortOrder>90</SortOrder>
<Icon>SampleSolution.ico</Icon>
<CreateNewFolder>false</CreateNewFolder>
<DefaultName>SampleSolution</DefaultName>
<ProvideDefaultName>true</ProvideDefaultName>
</TemplateData>
<TemplateContent>
<ProjectCollection>
<SolutionFolder Name="SampleFolder">
<ProjectTemplateLink ProjectName="$ProjectName$">Projects\ConsoleApplication\ConsoleApplication.vstemplate</ProjectTemplateLink>
</SolutionFolder>
<SolutionFolder Name="Other Projects" />
<SolutionFolder Name="WebSites">
<ProjectTemplateLink ProjectName="$WebSiteName$">Projects\WebSite\WebSite.vstemplate</ProjectTemplateLink>
</SolutionFolder>
</ProjectCollection>
</TemplateContent>
<WizardExtension>
<Assembly>Microsoft.Practices.RecipeFramework.VisualStudio, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35</Assembly>
<FullClassName>Microsoft.Practices.RecipeFramework.VisualStudio.Templates.UnfoldTemplate</FullClassName>
</WizardExtension>
<WizardData>
<Template xmlns="https://schemas.microsoft.com/pag/gax-template"
              SchemaVersion="1.0"
              Recipe="CreateSolution">
<References>
<RecipeReference Name="HelloWorldRecipe" Target="\SampleFolder" />
<RecipeReference Name="CustomWizardPages" Target="\SampleFolder" />
<RecipeReference Name="HelloWorldRecipe" Target="\WebSites\$WebSiteName$" />
<RecipeReference Name="HelloWorldRecipe" Target="\WebSites\$WebSiteName$\Web.config" />
<RecipeReference Name="HelloWorldRecipe" Target="\WebSites\$WebSiteName$\Other" />
<TemplateReference Name="Projects\ClientApplication\ClientApplication.vstemplate" Target="\SampleFolder" />
</References>
</Template>
</WizardData>
</VSTemplate>

For more information about the syntax of Visual Studio templates, see Syntax of Visual Studio Templates.

See also

Developing Visual Studio Templates | Syntax of Visual Studio Templates | Defining Solution Template | Defining Item Template