Click here to Skip to main content
15,892,161 members
Articles / Templates
Tip/Trick

How to Create a Project Template for Visual Studio

Rate me:
Please Sign up or sign in to vote.
4.57/5 (5 votes)
8 Feb 2015CPOL2 min read 31.9K   7   2
This short tip will show you how to create a project template for Visual Studio and make it available for any VS user.

Extending Visual Studio Templates

Visual Studio comes with multiple project templates for each technology. But, you may need to create your own to include the files and folders you want. Fortunately, and as any excellent IDE, VS can help you make your personalized template. If you wonder how we can do it, then you might be interested to continue reading this tip.

Let's suppose you have a project containing your own folders and files. To create the project template, you'll need to go through the following 2 steps:

1. Exporting the Project

You open your project with Visual Studio, then go to File and select Export Template.

Image 1

Once done, the following dialog will show up asking what type of template you want to make. Go and select Project Template and select the specified project if you have more than one in your solution.

Image 2

Then another dialog will appear asking for an icon and the template name and description. When clicking Finish, the project template will be created and exported to Documents\Visual Studio 2013\My Exported Templates as a zip file.

2. Creating the VSIX

In this step, you will need first to have Visual Studio SDK installed. You can download it from here: http://www.visualstudio.com/downloads/download-visual-studio-vs.

When creating a new project, you will have an item called Extensibility, click it and select VSIX Project.

Image 3

From the vsixmanifest dialog, select option Asset and click New. Here is where you want to get the exported project and make it a project template. To do so, choose Project Template for the Type and browse to the path of the previously exported project. Then click Build and the vsix file will be created at the Debug or Release folder of your VS project.

How to Test It ?

To test it, you may hit Start from VS, that will start a new experimental instance of VS, which has the extension pre-installed. Alternatively, you can double click the vsix, install it and fire up a new instance of VS. Now you will see your template appearing on the New Project dialog in VS!

Publish It to VS Gallery

The vsix extension you have created could be published to the Visual Studio Gallery to make it available for anyone using VS. To do that, you should go to https://visualstudiogallery.msdn.microsoft.com.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer Microsoft
Tunisia Tunisia
I'm a Software Engineer and MVP (Client Development). I like writing articles and developing open source software in C#, Windows Phone and Windows 8 applications droidcon.tn/speakers.php.
http://houssemdellai.net

Comments and Discussions

 
QuestionImages? Pin
Klaus Luedenscheidt8-Feb-15 19:19
Klaus Luedenscheidt8-Feb-15 19:19 
AnswerRe: Images? Pin
Houssem_Dellai8-Feb-15 21:31
Houssem_Dellai8-Feb-15 21:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.