I would like to have a multi-project template that will create sub projects, and will install the nuget dependencies as well as have a vsix installer that will install this
I finally have the setup working. It took me many days of experimenting and patching together different MSDN articles and blogs to figure this out.
Combining Multi project template (with root template) and VSIX
The end result is
When creating a project with this template, it automatically creates multiple sub-projects, yet, the sub-projects are not (but can be) available as templates in the new project menu themselves. This is great if you are trying to template something like an enterprise design that is dependent on many projects working together, but you don’t want the user to be able to create these sub projects, or you want them to be available in a different project template area/category.
Steps:
Add the following to the file:
<WizardExtension>
<Assembly>NuGet.VisualStudio.Interop, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</Assembly>
<FullClassName>NuGet.VisualStudio.TemplateWizard</FullClassName>
</WizardExtension>
<WizardData>
<packages repository="extension" repositoryId="fill this in">
<package id="Newtonsoft.Json" version="5.0.6" />
</packages>
</WizardData>
Open your first project you wish to use as a “sub project” template, export template from File->Export Template.
and paste in the following below the TemplateContent block (for example if you want to add a Json nuget package)
<WizardExtension>
<Assembly>NuGet.VisualStudio.Interop, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</Assembly>
<FullClassName>NuGet.VisualStudio.TemplateWizard</FullClassName>
</WizardExtension>
<WizardData>
<packages repository="extension" repositoryId="fill this in">
<package id="Newtonsoft.Json" version="5.0.6" />
</packages>
</WizardData>
Zip up your entire root folder MyTemplate, so you end up with MyTemplate.zip which has the contents of the MyTemplate folder.
Optional Step to have your master project rename your files and namespaces
<DefaultName>$safeprojectname$.Domain</DefaultName>