Thursday, 06 December 2007

VSX on Code To Live



# 

Code To Live I recently did an interview and quick demo with Josh Holmes from the Code To Live podcast.  The topic was Visual Studio Extensibility. 

I liked having the opportunity to show some code as well as talk about the technology.  The demo was recorded in the speakers' lounge at the Memphis Day of .NET.

If I seem overly mellow in the interview, it is due to exhaustion.  It was recorded at the end of the first day of DevLink, after I had given two talks.  After I finished the interview (and my cigar) I headed back to the hotel to crash.


Code To Live: Alan Stevens talks on Visual Studio Extensibility

Enjoy,

++Alan

 Saturday, 03 November 2007

Visual Studio as an Application Platform



# 

Josh Holmes blogged about Microsoft as a platform company rather than an application company.  He referred to VSTO as making Office a platform for other companies to develop applications.  He further mentioned Facebook's recent success as a platform for others to extend.

I heartily agree with everything that Josh is saying.  I think I heard the same argument a few years back.  Jerry Pournelle has said for years that while OS/2 was the better OS technically, IBM wanted to sell the SDK, while Microsoft was slipping Windows SDK CDs in every Comdex attendee's bag.

I especially endorse Josh's argument that Firefox is a better platform than Internet Explorer.  It doesn't have to be that way, but it is, for now.  Firefox has some flaws in its add-in model.  I keep expecting Microsoft to release a managed API like VSTO or the MPF for IE.

Software development is constantly in flux.  Should we build web apps, Windows Forms apps, Click Once smart clients, WPF or Silverlight apps?  For my eight years as a software developer, I have built applications that leverage the power of the desktop computer.  I like desktop apps.  I use web apps, like gmail, del.icio.us and Google Reader, but I prefer a rich desktop application UX.

Perhaps I'm becoming a curmudgeon, but AJAX doesn't excite me.  It's still just JavaScript, and it's still slow.  I'm not foolish, I realize that the trend will continue to be leveraging the web as a platform, as more previously desktop only applications move into the browser, and I don't think this is a bad thing.

What I know is that no web app can completely duplicate the rich UX of a desktop application, no matter how many smart people argue otherwise.  I use OWA frequently, but it is not a replacement for Outlook.  In fact, I think Outlook is the best example of leveraging Office as an application platform.  The most recent release of VSTO made creating Outlook plugins significantly easier.

If I were still creating line of business applications as a consultant, I would be adding an Outlook dashboard to every client's system.  Check out TeamLook for an example of what I'm describing.  I keep expecting Microsoft to purchase Personify Design and make Juan independently wealthy.

As I examine my own computer usage I have identified one other desktop application that I believe will not be moved entirely to the web.  That application is Visual Studio.  I use it daily, and I cannot imagine an equivalent experience in a browser.  That is why I have been so stoked about VSX since I first heard about it.

I'm not sure the message has traveled throughout the developer community, but the new Visual Studio 2008 Shell turns Visual Studio into a platform for new application development.  It takes some explaining, but think of Visual Studio as a framework for building an application.  VS handles the main screen, and most of the plumbing, and you as the application developer focus on adding business value.

I'm not saying that the Visual Studio Isolated Shell is the right solution for every smart client application, but if the problem domain fits the Visual Studio tool and command metaphor, then it is worth your time to investigate.  I'll be speaking about exactly this topic on November 10 at the Memphis Day of .NET.  I'll also be blogging on Cave Markings about the progress I have made in exploiting the VSX tools for application development.  Stay tuned, the future is bright!

++Alan

 Wednesday, 31 October 2007

Speaking at Memphis Day of .Net 2007



# 

I'm excited to be speaking at Memphis Day of .Net 2007 next weekend.  I'm a former student at Memphis State... er, I mean University of Memphis, where the event is taking place.  This will be a bit of a homecoming.

I'll be talking about VSX, and getting into more detail than I have previously.  I've been digging deep into the Visual Studio 2008 SDK as work ramps up on VFP Studio.  Now that I have a better understanding, I'll be able to show how to create and access services in the shell.  Here's the session description:

VSX: Xtreme Xtensibility with the Visual Studio 2008 Shell and the Managed Package Framework

During this session we will look at ways to extend Visual Studio 2008 using the VS 2008 SDK. We will build extensions using the Managed Package Framework that access the same APIs that the Visual Studio team uses. We will explore the opportunities for distributing tools as packages to users without Visual Studio installed. Finally, we will examine the new possibilities for developing commercial software on top of the Visual Studio platform leveraging the Visual Studio 2008 Shell Isolated Mode.

Check out the rest of the sessions here.  It looks like a great lineup.  I hope to see you there!

++Alan

My Life | VSX    Comments [0]
 Friday, 19 October 2007

Southwest Fox Day 1



# 

I flew into Phoenix Thursday, and lost most of the day to travel + jet lag.  I did get to hang out with Craig Boyd and Bo Durban briefly.  Bo and I made a trip to the airport to pick up Dave Bernard.  Bo rented a sweet Shelby Mustang convertible for the week, so it was a fun trip.

Friday morning I was up at 5:00 am.  Traveling west makes me feel super human. :-D  I wanted to be certain that I had everything ready for my afternoon pre-conference session on test-driven development (TDD).  My concern was that I might not have enough material to fill four hours.  As it turned out, I could have filled an extra hour or two! 

Apparently my preparation payed off for attendees.  I got lots of positive feedback on the session.  Steve Bodnar has a very flattering review here.  I really enjoyed making the audience tell me what to type.  I let them set the requirements, then reason about how best to tackle the problem using TDD.  I had blast, and I'll probably continue to do talks on agile methodologies. 

At the speakers meeting, I was surprised to hear that I would be giving a keynote address with Craig Boyd!  I've never shied away from an opportunity to get in front of a crowd, but I thought that I might hear of this before the day of the event!  Craig and I spent the next hour getting our ideas together, and talking ourselves into a frenzy.  We are both totally stoked about the project we are working on.

Our project is called VFP Studio.  We are using the Visual Studio 2008 Isolated Shell to build an IDE for building Visual FoxPro projects inside Visual Studio.  We have plans to include reg-free COM for enabling click-once deployment of Visual FoxPro applications.  We are working on a VFP project type, so that we can add a new or existing VFP project to a Visual Studio solution.  We keep coming up with exciting possibilities for this project, and we will be announcing more soon.

While the other two keynote demos were definitely more mature than ours, I'm very excited that we were able to take this opportunity to announce what we are working on. By announcing the project last night, we were able to reach the most people who would use VFP Studio in one room.  Ken Levy, former Visual FoxPro PM and current community program manager on the Visual Studio Ecosystem team, was present at the keynote, and helped clarify what Craig and I were doing for curious attendees during the reception.  I can't wait to see what we have to share at next year's Southwest Fox conference.

My conference photo album is here.

++Alan

VFP | VSX    Comments [3]
 Tuesday, 09 October 2007

VSX: Iron Cool Stuff



# 

I've been combing through the Visual Studio 2008 SDK looking for cool stuff to highlight at DevLink.  There's plenty to show off in the SDK, but I'm smitten by the Iron Python Integration sample.  This is an example of total language integration. 

It's nice to see all the ideas about VS Packages demonstrated in one place.  I learn best by taking working things apart.  This is a great resource to pick apart.  Because it is such an extensive sample, including such features as project integration, language service, the documentation is particularly helpful as a map.

Every sample in the SDK has an excellent summary in the SDK browser which points in the right direction before you even open the code and start reading comments.  Here's an example from the IronPythonProject sample:

PythonProject.cs

Contains three classes related to the IronPython Project: the package, the project factory, and the project node.

Automation.cs

Contains a number of classes that enables automation of the IronPython project and py files in the Iron Python Project. Especially the project object enables the CodeModel

ConfigurationPropertyPages.cs

Contains a defintion for the build property page in the Project Designer.

EditorFactory.cs

Contains a definition for the editor factory that creates the editor for editting iron python code files in code/design view

These descriptions make me want to dive in and see how it all works.  Unfortunately that's too much detail for my DevLink session. 

If you work with Visual Studio regularly, you will benefit from learning about the inner workings of the tool.  Grab a copy of the SDK and take a look.  If you are at DevLink this week, come by and I'll try to convince you that Visual Studio Extensibility is worth your time.

++Alan

VSX    Comments [0]
 Tuesday, 02 October 2007

Loose Ends



# 

I'm picking up some loose ends this week.  I've had a couple of projects "in process", read totally ignored, for a few months.  This week I'm getting back in the groove and making progress on both of them.

First, thanks to some insistent encouragement, read nagging, from Craig Boyd, I have the VFP Build Target code up on CodePlex.  The initial commit should be seen as a design document.  I didn't write the initial implementation, Paul Witt did.  Paul is our configuration manager at DPRA and as such, he's responsible for the builds. 

After a conversation and an exchange of links to documentation, Paul built a working implementation of the VFP Build target to be called from Team Build.  Paul discovered that the build would hang if there was a problem with the build, because VFP was showing a modal dialog.  Paul set up a timer to call a separate program to kill the, now hung, VFP process.

I took Paul's code and removed the parts specific to our build process, and attempted to simplify the structure.  I also converted the build task class to C#.  Now that it's posted, I'll create some unit tests and documentation, so others can begin playing with it. 

My other loose end is my foray into the wilds of VSX.  I began an earnest investigation into the new Visual Studio extensibility features, but I got sidetracked by two exciting opportunities.  Neither opportunity played out, but I learned some things from the process.

Late last week, CoDe Magazine published VSX CoDe Focus magazine.  You should check it out.  In two weeks I'll be doing a talk on VSX at DevLink, so I will be spending my free time making sure I'm up to speed on all the latest updates.

If you are interested in influencing the future of Visual Studio Extensibility, be sure to take the survey.

++Alan

VFP | VSX    Comments [0]
 Sunday, 08 July 2007

My 2007 Speaking "Tour"



# 

In 2005, I began giving talks at our local user group.  In 2006, I spoke at the Atlanta Code Camp, FoxForward and DevLink.  This year, I joined Toastmasters in anticipation of even more speaking opportunities.  I have not been disappointed.

In January, I delivered a talk on Creating Windows Services at the NashDotNet users group.  I am currently preparing six talks for three different conferences on a wide variety of topics.  Fortunately, I picked the topics. ;-)  Each of these presentations is on a topic of great interest to me.

In September, I'll be at FoxForward near Atlanta, discussing TDD and an approach to application architecture I call OGLE. In October, I'll first head to Nashville for DevLink, where I'll be talking about VSX, and the Entity Framework.  The following week I'll be in Phoenix at Southwest Fox, where I'll do a longer pre-conference session on TDD, and a regular session on extending Visual FoxPro applications with Windows Forms elements.

In addition to these great events, I've committed to speak at the Memphis Day of .NET in November.  Details are still being finalized for that event.  I'll also be giving a talk introducing the Entity Framework at ETNUG, most likely at the August meeting.  I'm hoping to add a couple more engagements before the end of the year.  I'll let you know if anything works out.

If you have ever considered giving a technical presentation at a user group, or regional event, I encourage you to act on that thought.  Sharing ideas and interacting with other members of the community at these events has been extremely rewarding for me.  If you attend any of these events, please introduce yourself.

Cheers,

++Alan

 Thursday, 05 July 2007

VSX - Slow Progress



# 

I'm still working on the tutorials, but the holiday has offered a nice break from technology.  It's good to be reminded that I have other roles in life, like "Dad" and "friend".  Here's the latest I have to report.

After ranting about the annoying CTC files, I learned about the new VSCT file format.  There is also a prerelease compiler for the new file format.  This looks like a major improvement to VSX, but it isn't part of the tutorials, so I'll plow ahead.

I looked over the VSSDK Assist site, and decided this was a tool I wanted to use.  Unfortunately, it failed to install for me.  I've reported the bug.  I'll try it on an XP box and see if I have more luck.

++Alan

VSX    Comments [2]
 Tuesday, 03 July 2007

VSX - First Impressions



# 

You only get one chance to make a first impression.  I want to record mine regarding VSX before I get too familiar with it.

First, the documentation and comments in the project template are very thorough and helpful.  If the legacy systems I've supported in my career were half as well documented, I'd probably be less obsessed with TDD these days.

Speaking of TDD, there is a great set of sample projects in the SDK.  These are found in %VSSDK_InstallDir%\%Version_Number%\VisualStudioIntegration\Samples\IDE\CSharp\.  In that folder, there are some reference projects, each of which include a TDD\ folder with unit tests.  Sweet!

So, kudos to the VSX team for the good documentation and the unit tests, on to what was less than stellar.  There must be a way to abstract the CTC file.  It isn't poorly formatted for a config file, but It could be so much better.  XML anyone?  I know XML takes it's lumps when it is used for scripting, or as a data serialization format, but it is ideal for a config file.

At the very least, there needs to be a CTC Editor GUI tool to prevent me from fat fingering some comma separated value.  Here is an excerpt from the tutorial:

This line contains comma-delimited fields. The first field is the command that will receive the key binding. This field is in the form GUID:ID, where the first part is the GUID for the package, which is defined in Guids.h (also in the CtcComponents folder). The second half is the command identifier you typed in when you ran the wizard; this identifier is defined in CommandIds.h (which is also in the CtcComponents folder).

The second field is a GUID representing where this keyboard shortcut will be available. Different parts of Visual Studio can have different keyboard handlers. For example, when you are inside a text editor, the keyboard shortcut CTRL+I runs the Incremental Search command. But when the Solution Explorer is active, CTRL+I has no key binding. Thus, CTRL+I is only available to the text editor.

We want our keyboard shortcut to be available everywhere in Visual Studio; thus, it will be global. For global keyboard shortcuts, we use the GUID defined by guidVSStd97.

The third field is not presently used; for now, you use the same identifier from the second field, guidVSStd97.

The fourth and final field is the keyboard shortcut. This takes the format 'character':otherkeys, where the character for the shortcut goes in single-quotes. The otherkeys portion represents SHIFT, CTRL, and ALT with the letters S, C, and A, respectively. In this sample we're using CS, which means CTRL and SHIFT. The letter used in this example is M; thus, this keyboard shortcut is CTRL+SHIFT+M.

Couldn't I have an editor that allows me to select values from lists, rather than manually locating them in guids.h?  This is "hold your mouth right" programming.  How am I supposed to remember that the third field isn't used, and why do we put in a value if it isn't used?  How about creating an enum that I can access in code, rather than making me remember the constant guidVSStd97?  How long can I continue with these rhetorical questions?  Seriously, this aspect of VSX screams for better tooling.  Perhaps this is what VSSDK Assist does.

Finally, I have a real issue with the PLK.  It is a bottleneck to community development to request a new key for every dll.  Perhaps we could have one key for all community created packages, while commercial vendors are required to have unique keys.

If I sound negative, it's only because I know I will become accustomed to these annoyances in my quest to master VSX, and I want to record them to remind myself what it was like to be a noob. :-)

Cheers,

++Alan

 Monday, 02 July 2007

VSX - Know Your Tool



# 

If you've ever read The Pragmatic Programmer, and you should, it makes a mantra of DRY (don't repeat yourself).  The point is that you have enough to do developing good software.  Don't waste time on repetitive tasks.  I apply the same principle to DRY that I apply to OOP.  If I see the same scenario in code three times, I abstract it into a class.  So, if I have to perform some boring, or at least repetitive, task three times, I automate it.  Well, that's the plan anyway.

This is my motivation for getting into VSX.  I don't want to perform the grunt work involved in creating Model View Presenter designs.  I want to focus on the interesting job.  It is the what, not the how that is difficult to get right in software development.  I hope to build some tools that allow me, and my fellow developers, to focus on the interesting work.

I decided to begin my investigation with the Visual Studio Extensibility QuickStart Tutorials.  These six labs promise step-by-step introductions to the various forms of VS extensions.  Below are my notes, so you can follow along from home.


In order automate tasks at a fine grained level in VS, you'll want to use the Managed Package Framework (MPF).  This is a managed API introduced in Visual Studio 2005.  Classes in the MPF are found primarily in the Microsoft.VisualStudio.Package and Microsoft.VisualStudio.Shell namespaces.  In order to manipulate the MPF, you interact with numerous interfaces.  You will implement many of these IVs* interfaces in your classes, so that VS knows how to interact with your package.

The primary elements available for creation are tool windows, document windows and commands.  In the new VSPackage wizard, the options are listed as Menu Command, Tool Window and Custom Editor.  Commands display visually as buttons on menus and toolbars.  Commands are also available in the command window by category.  Type "build." in the command window, and intellisense lists the commands available in the build category.

It can be useful to bind a keystroke to your custom commands.  The comments in the template for VS commands warn:

Notice that Visual Studio has a lot of components and commands, so it can be difficult to find a key binding not used by somebody else; if the key bindings are conflicting only one will be used and one problem is that the shell will not inform the user that a conflict was found. The only  way to detect the problem is to start Visual Studio under debugger, try to execute any command and look if there is a message in the output window about a duplicated accelerator found.

In order to distribute your package, you must request a Package Load Key from the VSIP site.  This is an unnecessary hassle, it seems to me.  I've requested a PLK for the package I created following the tutorials.  I understand the need to track commercial packages which extend the VS shell, but it seems like overkill for personal extensions.


It's 11:30, and I've only finished the second tutorial.  I'll pick this up again tomorrow.

Cheers,

++Alan

Going Deep with VSX



# 

I'm taking some time off around the Independence Day holiday this week.  I have several projects queued up for attention.  One that has priority for me is an investigation of VSX.  I was introduced to the latest efforts by Don and Ken while I was at TechEd.  I don't have much to report yet, but I would like to share some resources that I'll be exploring:

That ought to keep me busy for a few days!  I've got some ideas that I would like to implement in the IDE, but I don't know how to get started as yet.  I'll report back when I've learned something.

Cheers,

++Alan