Sunday, July 29, 2007

Adding TFS-related commands in VSIP package

If you want to extend Team Foundation Visual Studio integration, the easiest way would be to write an add-in using VS automation. Alternatively, you may want to develop full-blown integration package; while it gives you much more flexibility, thing also become more complicated.

One of the differences is the way to add commands/menus. In VS package implementation you would use CTC (Command Table Compiler) file for that, and you will be required to know the GUID:ID pairs for the parent menus when adding your custom commands. And getting this information might take some do, especially for Team Foundation related menus!

Obvioulsy, firts thing is to browse through the header files included in VS 2005 SDK. But the thing is that the GUID:ID information for Source Control Explorer/Work Items menus is not located with the rest of similar IDs in stdidcmd.h/vsshlids.h headers, or other headers in Include folder.
But never give up! There are two additional headers, TFS_VC_IDs.h file located under Program Files\Visual Studio 2005 SDK\2007.02\VisualStudioTeamSystemIntegration\Version Control folder and containing version control related menu and command IDs, and TFS_WIT_IDs.h file located under Program Files\Visual Studio 2005 SDK\2007.02\VisualStudioTeamSystemIntegration\Work Item Tracking folder and containing work item related IDs. Great thanks to Chad Boles@Microsoft for the info!

Interesting thing is, that the information is available on WWW - but I'll be darned if I could google that (and I am pretty good at that too)! So here it goes - there is a post in Brian Keller's blog that mentions those headers. Do you think you could find that?

And in conclusion, couple of more related links. If you have troubles looking up GUID:ID pairs for CTC definitions (which easily could be the case if you are trying to extend custom packages), the technique described in the following Martin Tracy's blog post may be very useful. In fact, using that approach I got the IDs right before getting the official answer :)

And if you want to understand CTC better, this here post supplies lots of useful details on how to create bare-bones CTC without headers and pre-compiler.

No comments: