Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Include Custom DLL's in Visual Studio Project Template

I am trying to create a project template in Visual Studio 2008 and have had success in doing so.

Is it possible to include some custom assemblies in my project template so I don't have to add a reference to these assemblies once I instantiate a new project? If this is possible, how would I go about do this?

like image 230
coson Avatar asked Apr 22 '09 22:04

coson


1 Answers

I needed to do this myself. The best way to do it today, is to create a nuget package which contains all your 'content' - such as DLLs. Then add the nuget package wizard to the WizardExtension section of your vstemplate, and add your nuget package (as either a reference to an online repository, or the actual embedded .nupkg file)...

Your nuget package will be packaged in your final VSIX file - so rolling everything out into a Visual Studio deployment will be a simple double click. What will happen when a developer creates a new project based on your template, is the project structure will be created, then Visual Studio will see there is a Nuget dependency, and it will automatically install your nuget package into the new template, and add the appropriate references to the project.

Here are a couple of fully fleshed out explanations of how to achieve this - Marcin's example has a downloadable zip example (you can find the link in his comments):

Kedar R Kulkarni

Marcin Doboz

like image 169
Adam Avatar answered Sep 17 '22 17:09

Adam