Include NuGet Packages in Visual Studio Project Template

In a single Visual Studio project template, you can include NuGet packages so that when project is added, the NuGet packages are pre-installed.

A small modification is necessary if you are going to use this to create new project.

Edit .vstemplate file to include:

<VSTemplate>
    <WizardExtension>
        <Assembly>NuGet.VisualStudio.Interop, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</Assembly>
        <FullClassName>NuGet.VisualStudio.TemplateWizard</FullClassName>
    </WizardExtension>
    <WizardData>
        <packages>
            <package id="jQuery" version="1.6.2" />
        </packages>
    </WizardData>
</VSTemplate>

Where <packages> will include all packages pre-installed to the Visual Studio template.

Source: NuGet Docs

1 thought on “Include NuGet Packages in Visual Studio Project Template”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s