5

I am in the process of creating multi-project solution template having web application,Desktop,few class libraries and unit test project.

I built the basic container and packed it as VSIX container. When I install the VSIX container,I can the .zip file of my solution template in the following physical path

%AppData%\Local\Microsoft\VisualStudio\11.0\Extensions\tbxs0hui.w2e\ProjectTemplates\CSharp\1033\myprojecttemplate.zip,so everything is fine.

But When I launch Visual Studio 2012 ,I could not see the my solution template listed under New Project - > Visual C#.

When I am going wrong? Any suggestions?

Here is the Multisolution RootTemplate.vstemplate content:

<?xml version="1.0" encoding="utf-8"?>
<VSTemplate Version="3.0.0" Type="ProjectGroup" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" xmlns:sdk="http://schemas.microsoft.com/developer/vstemplate-sdkextension/2010">
<TemplateData>
<Name>MultiProject</Name>
<Description>MultiProject</Description>
<Icon>MultiProject.ico</Icon>
<ProjectType>CSharp</ProjectType>
<RequiredFrameworkVersion>2.0</RequiredFrameworkVersion>
<SortOrder>1000</SortOrder>
<TemplateID>bbd7217a-8572-4edc-80ce-488cb9a347df</TemplateID>
<CreateNewFolder>true</CreateNewFolder>
<DefaultName>MultiProject</DefaultName>
<ProvideDefaultName>true</ProvideDefaultName>
</TemplateData>
<TemplateContent>    
<ProjectCollection>
<SolutionFolder Name="FolderName1">
  <SolutionFolder Name="FolderName2">
    <ProjectTemplateLink ProjectName="xxxxx">Children\Application1\Application1.vstemplate</ProjectTemplateLink>
    <ProjectTemplateLink ProjectName="yyyy">Children\Application1\Application2.vstemplate</ProjectTemplateLink>        
  </SolutionFolder>
  <SolutionFolder Name="Folder3">
    <ProjectTemplateLink ProjectName="zzzzzz">Children\Application3\Application3.vstemplate</ProjectTemplateLink>
  </SolutionFolder>
  <SolutionFolder Name="Web">
    <ProjectTemplateLink ProjectName="Web">Children\Web\Web.vstemplate</ProjectTemplateLink>
  </SolutionFolder>
</SolutionFolder>    
<SolutionFolder Name="Tests">      
    <ProjectTemplateLink ProjectName="xxxxxTest">Children\ApplicationxxxxUnitTest\ApplicationxxxxUnitTest.vstemplate</ProjectTemplateLink>
<ProjectTemplateLink ProjectName="yyyyyTest">Children\ApplicationyyyyUnitTest\ApplicationyyyyUnitTest.vstemplate</ProjectTemplateLink>
<ProjectTemplateLink ProjectName="zzzzzTest">Children\ApplicationzzzzUnitTest\ApplicationzzzzUnitTest.vstemplate</ProjectTemplateLink>
<ProjectTemplateLink ProjectName="WebTest">Children\ApplicationWebUnitTest\ApplicationWebUnitTest.vstemplate</ProjectTemplateLink>
</SolutionFolder>   
</ProjectCollection>
</TemplateContent>
</VSTemplate>

After Installing the VSIX,I can see a New Project called "MultiProject" in VS2012.When I create a new project,the four test projects does not get created under Tests folder.I tried replacing them with class library under Tests Folder in vstemplate,It is working fine,Only unit test projects with ProjectTypeGuid {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} are not getting created under Tests Folder.

Jason Malinowski
  • 18,148
  • 1
  • 38
  • 55
Soni Qureshi
  • 97
  • 2
  • 8

2 Answers2

0

Try running devenv /setup so that Visual studio recognizes that you have placed a new template there.

Anyway for custom templates, I would rather suggest you to put the .zip file in

%DOCUMENTS%\Visual Studio 2012\Templates\ProjectTemplates\Visual C#

since VS itself picks up the template from here and you wouldn't have to run devenv /setup explicitly.

Adith
  • 177
  • 2
  • 6
0

I had the same problem,

How are you creating the templates? There are two ways of creating a template:

  1. File --> Export template.. if you do it this way will not work in VS2012 with VSIX packages
  2. Create your templates directly with C# Project template (under Extensibility)

The second way worked for me.

Javier Hertfelder
  • 2,432
  • 4
  • 22
  • 36