How to build a package for VS Shell

I said I would follow up with a post on how to build a VS Package that targets the VS Shell, so here it is.

Creating a VSPackage for the isolated Shell is a little different than the other two scenarios because you will also need to create your own stub .exe, and VSPackages need to be registered differently. Note that these are the only real differences; there is both source- and binary- level compatibility for VSPackages across Visual Studio and the Shell editions.

When you deploy a VSPackage that targets an isolated Shell, you create package definition files (.pkgdef) that contain the registry information that you would normally apply directly to the registry if you were targeting Visual Studio or the integrated Shell. If you are using the managed package framework for your extension, you can easily produce such package definition files by using the /pkgdeffile switch with the regpkg.exe tool that ships with the Visual Studio SDK. Remember also to use the /codebase switch unless you are planning on GAC'ing your assembly (you wouldn't do this usually). Once you have produced the .pkgdef files, you just need to place them into a special PackagesToLoad folder along with your package binary, and your instance of the isolated Shell will automatically detect and install this new package when it is run with the /setup switch. Usually, you will run <yourAppName> /setup as a custom action in your setup program.

When you are building on the isolated Shell, you will also need to create your own stub .exe file. This is logically equivalent to devenv.exe for Visual Studio, and it is automatically generated for you when you are choosing to create a Shell instance with the Visual Studio SDK. As part of your setup program, you will also need to install this .exe, in addition to your VSPackage and the redistributable package.

 

That's it for now. While I know there are still bugs with VS Shell, I hope this will get you started. Let me know how things go!

thanks,
James