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

丶灬走出姿态 提交于 2019-12-18 11:59:40

问题


hey guys, 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!


回答1:


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.




回答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.



来源:https://stackoverflow.com/questions/855808/visual-studio-2008-plug-in-add-in-development-getting-started

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!