If you've read any of the introductory material to VSIP (see below), you've undoubtedly come across the concept of services. A package can offer a service to itself and to other packages running inside the Visual Studio shell. If you're using the VSIP Extras Helper Classes, proffering a service is a piece of <insert favorite dessert item />. Craig Skibo had a brief blog about this a few days ago, but this should provide some more detail. Here are the simple steps you need to follow:
(What this does is put some metadata into the assembly that’s generated when you build your package. If you look at the post-build step that the wizard generated in your C# project, you’ll notice that a tool called “VSIPRegPkg.exe” is called on your package assembly. When VSIPRegPkg.exe examines your assembly, it sees the ProvideService attribute and automatically puts the correct values into the registry for you in order to have your package load and offer a service in Visual Studio. Cool!)
Now you should be able to call your service from any other package that you write! To load the package and access the service, simply do something like this from your package that's calling your service:IAaron service = (IAaron)GetService(typeof(AaronService));
I can now call any of the methods in the IAaron interface that I implemented in the AaronService class. And that, my friends, is how you proffer a service in managed code. J
As a final note to this [long] entry, AllenD wrote a blog entry about a month ago that describes how you go about accessing services provided by the VS shell from within a package. I would also recommend checking that out.