I am building a Visual Studio 2015 Web API 2 template for my company. It is a multiproject template. I have it all setup and it is working fine except for the Nuget packages. They will not install.
I followed the steps outlined here: https://learn.microsoft.com/en-us/nuget/visual-studio-extensibility/visual-studio-templates.
Here is what I have setup:
The
.nupkg
files in my vsix project. If I unzip the vsix, I see them in the Packages folder. (I copied these .nupkg files from the packages folder in my original solution I made.)I have listed every Nuget package as an asset in my
source.extension.vsixmanifest
file (found in the vsix project).
Here is an example:
<Asset Type="AutoMapper.5.2.0.nupkg" d:Source="File" Path="Packages\AutoMapper.5.2.0.nupkg" d:VsixSubPath="Packages" />
- In my sub-project .vstemplate files I have added the nuget wizard and listed the packages needed for that template.
Here is an example of one of my subprojects (the first wizard is my vsix project):
<WizardExtension>
<Assembly>MyVsixProject, Version=1.0.0.0, Culture=Neutral, PublicKeyToken=52156a0ac017d515</Assembly>
<FullClassName>MyVsixProject.WizardImplementation</FullClassName>
</WizardExtension>
<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="MyVsixProject.8b0b584a-d7ab-4608-e317-84e1aa773a01">
<package id="AutoMapper" version="5.2.0" />
<package id="EntityFramework" version="6.1.3" />
<package id="Microsoft.Net.Compilers" version="1.3.2" />
<package id="SimpleInjector" version="3.2.0" />
</packages>
</WizardData>
Near as I can tell, I am following the instructions.
However, when I run the template, the solution level folder does not have a packages folder and all my nuget based references are broken.