Visual Studio 2008 Plug-in / Add-in Development - Getting Started

Hi guys, in connection with https://stackoverflow.com/a/2129605/2129 , how would I start creating my own Visual Studio 2008 plugin.

I checked Visual Studio Development Center on MSDN, but the amount of information is overwhelming. There are many types of projects, and I don’t even know where to start.

Where can I start looking if I want to write something that meets the following requirements:

  • A plugin that works as a “service” in Visual Studio, and can interrogate Visual Studio for information and handle Visual Studio events.
  • The information that I would like to receive from VS is such things as which projects are currently open, who is opening them, and other information based on the project file / file.
  • The events that I would like to handle include: opening / closing / editing / creating / deleting solutions / projects / individual files.
  • I would also like to be able to handle any interaction with VS based on each solution. Thus, I would like to handle any interaction with files, even editing the code, but also other interactions, for example, with the menu or only with the IDE itself.

In addition, I would also like to be able to store data somewhere. Where is this usually done? Can I add metadata to the solution file? Or does it make sense to store this information in a small local database instance that is somehow attached to the solution ..?

I just need a push in the right direction, is that possible? What part of the Visual Studio Development Center should I focus on? What APIs should I check?

Hooray!

+7
plugins visual-studio visual-studio-addins extensibility
source share
2 answers

An add-in can do most of this. There is a template in VS2008 for creating a basic add-in.

I have an add-in where you can load these hooks into project / project load events, etc. - It's free and comes with source code ( http://www.huagati.com/projectloader/download/huagatiprojectloader.zip ). This particular add-in detects when projects / solutions are loaded, and preloads the referenced assemblies to work with the CLR error, which could cause the VS2008 to crash. Anyway, the source code for it shows how to identify some of the events you are looking for.

In addition, the final add-on development resource and all the little quirks and tricks are related to Carlos Quintero's blog ( http://msmvps.com/blogs/carlosq/ ) and a series of "howto" articles on his website ( http: // www .mztools.com / resources_vsnet_addins.aspx ).

The Craig Skibo blog ( http://blogs.msdn.com/craigskibo/ ) also contains some useful tips.

+6
source share
+2
source share

All Articles