Pablo Galiano : Tuesday, July 03, 2007 - Posts

Subscriptions

<August 2008>
SuMoTuWeThFrSa
272829303112
3456789
10111213141516
17181920212223
24252627282930
31123456

News

Subscribe to Pablo Galiano by Email

Post Categories

Tuesday, July 03, 2007 - Posts

Registering a VSX Package programmatically

The regpkg utility located under %VSSDK_InstallDir%\%Version_Number%\VisualStudioIntegration\Tools\Bin\ is a managed assembly and provides the necessary API to do the common operations with VSX Packages that you usually do from the command line.

The RegPkg class is the one that exposes the API to deal with VSX Packages and it has the following useful methods signatures:

  • Register(string fileName, string regRoot, RegistrationMethod registrationMethod)
  • Unregister(string fileName, string regRoot, RegistrationMethod registrationMethod)
  • CreateReg(string fileName, string regRoot, RegistrationMethod registrationMethod)
  • CreateWix(string fileName, string regRoot, RegistrationMethod registrationMethod)

One important thing is that the regpkg utility isn't redistributable via the VS SDK license agreement, because of that this only apply to scenarios with the VS SDK installed.

There are a couple of *design-time scenarios* where this could be really useful, for example VSSDK Assist uses this approach to register/unregister a VSX package

Pablo

posted Tuesday, July 03, 2007 10:29 AM by pga with 0 Comments

The real type behind a System.__ComObject

Carlos posted some time ago a really interesting article on how to find the real object type behind a System.__ComObject. The .Object property of many classes of the Visual Studio Automation model returns this System.__ComObject type.

This is really useful and can save a lot of time when you need to debug your VSX Package or GAT Package. As Carlos pointed out you will need to add a reference to the Microsoft.VisualBasic.dll assembly, if you develop using the C# language you can remove this reference after you finished with the development.

 

Pablo

posted Tuesday, July 03, 2007 10:24 AM by pga with 0 Comments