Click here to Skip to main content
15,175,709 members
Articles / Operating Systems / Windows
Posted 21 Jun 2010


51 bookmarked

Write Templates for Visual Studio 2010

Rate me:
Please Sign up or sign in to vote.
4.86/5 (12 votes)
21 Jun 2010CPOL4 min read
A presentation about Visual Studio item and project templates - how they make you more productive, how to create and deploy them.

Title Slide


This article is part of my series on Visual Studio Extensions. Before you read it, please read the Introduction. It tells you the purpose of the series and gives you some tips on presenting my material. This article is designed to give you what you need to deliver a successful presentation. The speaker notes and demo script, along with the videos, are part of the package, and you won't learn everything from just the text of the article. My goal is to increase developer awareness of Visual Studio Extensions by making it easy for anyone to deliver a presentation on them at a user group, code camp, or the like.

Developers use project and item templates almost every day - creating new projects and adding items to existing projects. If they think about how those templates came to be, they probably assume it's a very difficult task suitable only for experienced developers, perhaps those on the Visual Studio team. This presentation aims to show that the very opposite is true. Anyone can create a project or item template. Whether it's to use yourself, to share with the team, or to share with the wider community, template creation is so quick and easy that you will save back the creation time the very first time you use it.

Presenting this session

This is a 300 level session for people who are comfortable with Visual Studio and have created plenty of projects. There are three demos, and because they have strong similarities, you need to work to keep it all straight for your attendees. I've recorded the demos and included links to them here so that you can see how it's all done. Once you know how to do these demos, you'll find the slides very easy to talk to since many of them just recap information from the demos. I do have speaker notes indicating what you can say to each slide. The demos take about half of a 75 minute slot, so you will have some time to talk to the slides.

Demo 1 - Item Template

This demo has a simple text file with boilerplate text in it that you might want to add as a new item to a variety of projects. You don't have to write any code, but you do have to drag things in and out of zip files and not get lost in a set of folders with very similar names. It's 9 minutes long.

Demo 2 - Project Template

Here, we make a project template from a project that has had a little customization applied. Like the item template, it's deployed by copying the zip to a magic folder, but towards the end, you can see that this approach is really a little fragile. This sets us up for the final demo. It's 13 minutes long, so I had to split it into two parts to upload.

Demo 3 - Deploying the Template

This demo continues from the previous one by showing how to deploy that template in a much safer and more robust way. It relies on an extension from Microsoft that simplifies building a VSIX dramatically. In fact, creating and using the VSIX is so simple you might miss it. This demo starts with showing you the gallery, then installs the extension right from inside Visual Studio. In no time, we re-export the template as a VSIX this time, and use it. Then, to round out the package, we put an icon, preview, and welcome page into the VSIX too. This is something everyone should do when they make a template. It's almost 16 minutes long, so I had to split it into two parts to upload.

Speaker Tips

Your goal for people leaving this session is that they see how simple it is to export a template and will create some of their own item and project templates to use in the immediate future. Some of them should also be planning to share those templates with team members. As well, if the Visual Studio Gallery is new to any attendees, they should be impressed by how easy it is to install useful extensions, and ready to take a look around and find some that they might like.

The Notes

Remember, you don't have to learn these just from the videos. There are detailed speaker notes and a demo script for you in the downloads for this article.


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


About the Author

Canada Canada
No Biography provided

Comments and Discussions

QuestionSpooky or disconcerting verbalizings Pin
B. Clay Shannon7-May-15 6:55
professionalB. Clay Shannon7-May-15 6:55 
GeneralMy vote of 5 Pin
kuanyong26-Nov-12 17:16
Memberkuanyong26-Nov-12 17:16 
GeneralMy vote of 1 Pin
Arnaud Dovi2-May-12 6:34
MemberArnaud Dovi2-May-12 6:34 
QuestionCan VSIX do what vstemplate can? Pin
Eric Wahner8-Mar-12 5:47
MemberEric Wahner8-Mar-12 5:47 
GeneralExcellent work and fantastic high quality videos! Pin
Dr. Frank Heimes2-Jul-11 0:23
MemberDr. Frank Heimes2-Jul-11 0:23 
QuestionC++ Project Templates Pin
Kerem Kat22-Jun-11 9:23
MemberKerem Kat22-Jun-11 9:23 
GeneralA project template bug Pin
jmertus30-Jan-11 3:27
Memberjmertus30-Jan-11 3:27 
GeneralCreate project dialog Pin
jhegedus28-Nov-10 16:22
Memberjhegedus28-Nov-10 16:22 
GeneralRe: Create project dialog Pin
jhegedus28-Nov-10 16:23
Memberjhegedus28-Nov-10 16:23 
GeneralGreat tutorial! Pin
Jalla Tjalabais30-Jul-10 3:15
MemberJalla Tjalabais30-Jul-10 3:15 
GeneralRe: Great tutorial! Pin
KateGregory30-Jul-10 3:22
MemberKateGregory30-Jul-10 3:22 
GeneralRe: Great tutorial! Pin
Jalla Tjalabais30-Jul-10 3:38
MemberJalla Tjalabais30-Jul-10 3:38 
GeneralRe: Great tutorial! Pin
deadlydog26-Aug-11 8:33
Memberdeadlydog26-Aug-11 8:33 
GeneralThanks Pin
devnet24721-Jun-10 20:11
Memberdevnet24721-Jun-10 20:11 

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.