Visual Studio 2008 Plug-in / Add-in development - Getting Started
Asked Answered
S

2

7

In relation to this stackoverflow question, how would I go about creating my own Visual Studio 2008 plug-in?

I've checked the Visual Studio Developer Centre on MSDN, but the amount of info is overwhelming. There are loads of project types, and I don't even know where to start.

Where should I start looking if I want to write something which meets the following requirements:

  1. A plug-in that runs like a "service" in Visual Studio, and is able to poll Visual Studio for information, and handle Visual Studio events.
  2. The info I'd like to access from VS are things like, what projects are currently open, who has them open, and other solution/project file based info.
  3. The events I'd like to be able to handle are things like, the opening/closing/editing/creating/deleting of Solutions / Projects / individual files.
  4. I'd also like to be able to handle any interaction with VS on a per solution basis. So, I'd like to handle any interaction with files, even code editing, but also, just other interaction, like with the menus, or just the IDE itself.

As well as these, I'd 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 save this info to a small local instance of a database, that is somehow attached to the solution..?

I just need a push in the right direction, is any of this possible? What part of the Visual Studio Developer Centre should I focus on? What APIs should I check out?

cheers!

Soekarno answered 13/5, 2009 at 2:38 Comment(5)
How ironic... I'm working on something that does precisely that- track how much time you spend working on a given solution/file in VS. How's it coming?Outsole
@dave: cool, I haven't actually even started...although I'd be really interested in how you're doing this. Will it be an Open Source project? If not, would love to know the higher level approaches you're taking. cheers!Soekarno
@andy: I just finished a prototype, still deciding whether to make it open source. In either case I'll be looking for beta testers soon... :)Outsole
@andy: vstime.codeplex.comOutsole
@Dave - dude, I'll check it out, good work man!!Soekarno
M
6

An add-in can do most of that. There's a template in VS2008 for creating a base add-in.

I have an add-in that you can download that hooks into the solution/project load events etc - it is 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 pre-loads referenced assemblies to work around a CLR bug that can cause VS2008 to crash. Anyway, the source code for it shows how to detect some of the events you're looking for.

Other than that, the definitive resource on add-in development and all the little quirks and tricks involved is Carlos Quintero's blog ( http://msmvps.com/blogs/carlosq/ ) and the "howto" article series on his website ( http://www.mztools.com/resources_vsnet_addins.aspx ).

Craig Skibo's blog ( http://blogs.msdn.com/craigskibo/ ) also has some useful tips.

Madai answered 13/5, 2009 at 2:51 Comment(1)
@kristoferA: hey kristofer, awesome, thanks for the source code, much appreciatedSoekarno
A
2

You want:

  1. Visual Studio Extensibility Developer Center
  2. VSX Forum
  3. Visual Studio 2008 SDK
  4. Professional Visual Studio Extensibility by Keyvan Nayyeri

Buy the book, if nothing else.

Annoyance answered 13/5, 2009 at 3:17 Comment(2)
cool, thanks Saunders, I'm not very good with learning from books, just doesn't click with me, call it dyslexia, ADD or...lazyness...surely not. I need to either just try it out or talk to someone about it. If I get stuck though, I'll definitely check it out.Soekarno
You're going to have a problem in this area, then. It's extremely rich, but not clean. The next step would be the samples in the VS2008 SDK, but good luck learning this area without some structure. BTW, I'm the last person on Earth likely to call this laziness.Annoyance

© 2022 - 2024 — McMap. All rights reserved.