Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Boosting Developer Productivity by Writing Extensions to Visual Studio 2008

0.00/5 (No votes)
6 Oct 2009 1  
How to write your own code snippets, macros, add-ins, templates, and wizards to make Visual Studio work your way.

Title Slide

Introduction

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 often believe that writing Visual Studio extensions is hard or not something for ordinary developers to do. Most are astounded to learn that the effort to create a simple extension will be repaid the very first time you use it. For example, writing a code snippet takes perhaps one minute more than just copying and pasting some code. The first time you don't have to go to look for the code to paste in, you will have saved that minute. Similarly, creating a project template or an item template takes about two or three minutes. This talk leads developers from these very easy steps right up to writing a wizard so that they will believe that writing their own extensions is something they can do.

Presenting this session

This is a 300 level session for people who know what extensions are. Some of them will be using extensions, others will be ready to use them if only they knew where to find them. You don't need to spend time on "What is an extension" or "why is extending Visual Studio a good thing" -- focus instead on showing them this is something they can do. All of the demos in this session are for Visual Studio 2008.

This is very much a demo driven session - about 70% of your time is demos, leaving about 30% not just for slides but for "Hi my name is" and "please fill out your evaluations". It's critical that your demos work perfectly - if you mess up and have to do it over, you won't just mess up your timing, you'll mess up the message of "this is nowhere near as hard as you think". And honestly, it isn't that hard at all.

I've recorded the individual demos so you can see how they're done and about how long they take. Once you know how to do these demos, you'll find the slides very easy to talk to since many of them are just "here is the XML" or some other information from the demos.

Demo 1 - Code Snippets

This quick two minute demo sets the tone for the session - "you can do this".

Demo 2 - Macros

At almost seven minutes, this demo has some meat to it, and should get attendees wondering what they could automate of their own tasks.

Demo 3 - Add-ins

This is a fourteen minute demo because you build the add-in piece by piece. It's easier to understand the code when it's built this way. If you are a terrible on-stage-typer, have the code ready to paste in from the toolbox. Do not be distracted by questions about the Speech object we're using. It comes with Windows and has a COM interface. It's on their machines whether they know it or not. This demo is not about text-to-speech, it's about a Visual Studio add-in, so stay focused on that. And, don't forget to un-mute your speakers so your audience can hear the results. (I have had to split it into two parts in order to upload it.)

Demo 4 - Templates

This is a bit of a breather from long demos at seven or so minutes, and it shows that templates can be as simple as choosing Export as Template from the File menu. Here again, they should be thinking "I can do this" while they watch you.

Demo 5 - Template Wizard

Before you start this demo, you need to check your clock and see how you've done. If you have 18 minutes or more left in the session, do the demo as I have done it here. If you ran long up to this point, you have to get the time back by doing a modified version of the process, showing the solution but not building it in front of them. The demo script doesn't detail that for you, so you should include in your practicing a few "let me show you the finished wizard" versions of the demo and know how long they take. (I have had to split it into two parts in order to upload it.)

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.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here