January 2011

Volume 26 Number 01

Toolbox - Visual Studio Tools and Extensions

By Terrence Dorsey | January 2011

Because you’re reading this magazine, there’s a good chance you sling code for a living. And if you sling code for a living, you probably spend a lot of time in your IDE ... which is—because you’re reading this magazine—probably Visual Studio.

Visual Studio 2010 is already an incredibly versatile coding tool. It does pretty much everything except write the code for you, and in many cases it’s getting good at doing that, too. Still, Visual Studio can’t do it all out of the box.

That’s where extensions come to the rescue. Visual Studio 2010 provides robust support for extensibility via custom tools, templates and plug-ins. (Note, however, that the Express versions of Visual Studio don’t support extensions.) If you can’t find the feature you need in Visual Studio, chances are there’s an extension that helps you customize the IDE or provides the tools you need to write code better and faster.

We’ll cover a few of the most popular free extensions for Visual Studio 2010.

Power Tools for Visual Studio There are thousands of extensions out there, and it just so happens that one of the most robust extensions was created by the Visual Studio team. Visual Studio 2010 Productivity Power Tools (bit.ly/g4fUGG) is a package of 15 handy features that range from Solution Navigator (think Solution Explorer on steroids) to tab autocompletion and highly configurable enhancements to tabs. Scott Guthrie explains how each of the features in Productivity Power Tools works on his blog, so check that out for details (bit.ly/aopeNt).

image: Solution Navigator in Productivity Power Tools

Solution Navigator in Productivity Power Tools

PowerCommands 10.0 PowerCommands 10.0 (bit.ly/hUY9tT), like Productivity Power Tools, is a grab bag of useful extra tools that will speed up or simplify common tasks in the IDE. You get 25 features in the package; they include robust copy and paste enhancements (copying entire classes, for example). The package also includes the ability to format your code, sort using statements and remove unused using references when saving.

Team Foundation Server Power Tools September 2010 Don’t feel left out if you’re using Visual Studio Team Foundation Server (TFS). Microsoft has a set of Power Tools for you, too. This extension (bit.ly/hyUNqo) gives you 11 new features that include check-in policies and item templates, a process editor, TFS command-line tools and Windows Powershell cmdlets, team member management, Windows shell integration and automated database backup.

Visual Studio Color Theme Editor It may not sound as glamorous, but sometimes it’s the little details that make coding that much easier. Take the colors used in the Visual Studio windows, tabs and menus, for instance. Do brighter colors cheer your mood? Are you particularly fond of magenta? Whatever you prefer, Visual Studio Color Theme Editor (bit.ly/fPKKEV) lets you customize all of the environment colors used in the IDE. You can also save themes and share them with your friends.

StudioStyles An even more personal choice is the colorization used for the code itself in your editor. StudioStyles (studiostyl.es) is a Web site that lets you download, create and share the .vssettings files that specify code colorization. Added bonus: These themes can be used with Visual Studio 2010, 2008, 2005 and even the Express versions.

image: StudioStyles

StudioStyles

WordLight Do you ever want to quickly find all the places you’ve used a method or variable name? WordLight (code.google.com/p/wordlight) is a simple extension for Visual Studio 2008 that lets you select some text and instantly highlights all other occurrences of that string in the code file. It also works in the Output, Command and Immediate windows.

Spell Checker If y0u tpye lke I do, the Spell Checker is a lifesaver. The Spell Checker extension (bit.ly/aMrXoM) looks for errors in the non-code portions of your files. It works in any plain-text files, for comments and strings in source code, and for non-tag elements of HTML and ASP files.

TortoiseSVN Add-in for Visual Studio So you’ve written and tested your code. If you’re working on a team or open source project, you probably need to commit your source to a repository. There’s a tool for that.

If you’re using Apache Subversion (subversion.apache.org) source control along with a TortoiseSVN client for Windows (tortoisesvn.tigris.org), there are a couple of Visual Studio extensions that incorporate the TortoiseSVN functionality into the IDE (tsvnaddin.codeplex.com), saving you many steps in the commit process.

VsTortoise When using TFS, you’ll need to add a layer such as SvnBridge (svnbridge.codeplex.com) that translates APIs between Subversion clients like TortoiseSVN (vstortoise.codeplex.com) and TFS.

Another popular source-code management system is Git (git-scm.com), and if that’s your preferred repository, then there’s an extension for you, too. Git Extensions (code.google.com/p/gitextensions) includes shell extensions for Windows Explorer and a Visual Studio plug-in. Plus, you can run most features from the command line.

NuGet Inspired by RubyGems and similar package-management systems from the Linux development world, NuGet (nuget.codeplex.com/) gives Microsoft .NET Framework developers the ability to easily incorporate libraries from source-code repositories directly into their local development projects. NuGet integrates with the Visual Studio 2010 IDE, and you can also run NuGet from the command line or via Windows PowerShell cmdlets.

image: NuGet

NuGet

Emacs and Vim Emulation In the beginning there was vi, and it was difficult to learn. Since those early days, Emacs and Vim have battled for supremacy as the One True Editor among coders. If you’ve chosen sides in that debate, yet find yourself using Visual Studio, then rejoice! The keybindings and many other features you know and love from Emacs and Vim are now available in extensions for Visual Studio.

You can follow the progress of VsVim (bit.ly/e3GsMf) developer Jared Parsons via his blog (blogs.msdn.com/b/jaredpar/). More information about Emacs emulation (bit.ly/eXhaIK), along with lots of other great tips, can be found on the Visual Studio Team blog (blogs.msdn.com/b/visualstudio/).

A Gallery of Extensions This is just the tip of the iceberg as far as Visual Studio extensions are concerned. Thousands of templates, custom controls and extensions are available through the Visual Studio Gallery (visualstudiogallery.msdn.microsoft.com), and more are being added all the time. Many are free, and there are trial versions available for many of the commercial products.


Write Your Own Extensions Don’t see what you need in the Visual Studio Gallery? Write your own! Visual Studio 2010 includes deep hooks for extensibility—anything from a custom project template to third-party tools that integrate directly with the IDE. Through the Extending Visual Studio developer center (msdn.microsoft.com/vstudio/vextend), MSDN Library articles and other resources in the Visual Studio community (bit.ly/aT1bDe), you’ll find a vast amount of information to start creating custom Visual Studio extensions. You’ve already got the tools ... start coding!  


Terrence Dorsey is the technical editor of MSDN Magazine*. You can read his blog at terrencedorsey.com or follow him on Twitter at @tpdorsey.*