VSMessenger: Taking the Extensibility Plunge
Visual Studio Extensibility can appear daunting to the uninitiated. This article will look at the blogging effort on VSSDK.com, as well as the VSMessenger sample application, and examine how they improve overall approachability to Visual Studio Extensibility.
In retrospect, some aspects of my initial transition from classic ASP to ASP.NET were brutally difficult. Sadly, a primary contributor to much of the difficulty during that transition stemmed from my lack of familiarity with object-oriented programming (OOP). In fact, when I got started with the .NET Framework (during initial beta stages of the 1.0 Framework) I was really nothing more than a self-taught scripter. Sure, I’d had plenty of experience coding with Visual Basic, VBA, VBScript, and even PHP-and while I loved using “classes” in PHP and VBScript 3.0, I really still didn’t fully understand all of the true benefits of OOP.
A perfect example of one of the times that I really wondered what in the world was going on with the .NET Framework was when I went to add a new ListItem to an ASP.NET DropDownList control that had already been populated from a database (i.e., imagine a drop-down with a list of all 50 U.S. states pulled from a database and wanting to add something like “Other” to the list without modifying the database). Using Classic ASP this would have been a trivial task; I would have just needed to emit more markup using whatever mechanism I had just used to populate the previous entries. In ASP.NET, adding this additional custom option was much harder. Not only did I have to get the timing of my “addition” right (otherwise I would overwrite my initial data-binding), but the whole process of programmatically creating a new ListItem instance, populating it with text, and then adding it to the collection of Items used by the DropDownList control just seemed like an incredibly huge amount of work for something that had been so trivial before.
In a large way, I think that my transition to ASP.NET from Classic ASP was very similar to what many developers go through when they make their first foray into Visual Studio Extensibility (VSX).
In a large way, I think that my transition to ASP.NET from Classic ASP was very similar to what many developers go through when they make their first foray into Visual Studio Extensibility (VSX). Take, for example, what is required to output some simple text in a Message Box from within a VSPackage:IVsUIShell uiShell =
Guid clsid = Guid.Empty;
Guid clsid = Guid.Empty;
"This is a message.",
0, // false
Merely scanning that code shows that it takes a lot more development and coding to output some simple text in a message box than what would be required of any .NET Windows Forms developer:MessageBox.Show("This is a message");
Note too that both of these examples are in managed code; but the VSX code looks an awful lot more complex. It can also look a bit daunting or even intimidating if you’re not familiar with all of the arguments and enumerations. However, if you’ve spent much time doing VSX and are used to the underlying paradigms involved, then the message box code above is really trivial.
By: Michael Campbell
Michael K. Campbell is an avid .NET developer and SQL Server wonk. He spends most of his time engaged in technical evangelism and consulting. You can contact him from any of his sites listed at www.overachiever.net.
VSSDK.com chronicles the real-life adventures of VSX developers and contains insights, resources, and even screen-casts to help get you started on your own path to Visual Studio Extensibility.
VSX Team Member
Visual Studio Ecosystem Team
I’ve recently joined the Ecosystem team and have been working on improving the Visual Studio Shell experience. I’m looking forward to seeing what innovations our community will bring to the Visual Studio platform with the advent of the VS Shell and the continual improvements to the VS SDK.