views:

32

answers:

1

Hey guys, I have a dilemma that I am uncertain about, as I not sure if it's is exactly possible for a Visual Studio Add-in to run its code automatically.

I need an add-in that can run passively, like a logger for Visual Studios. However, the Exec method that I know so far can only execute commandbar functionality, but I need the code to execute when the user right-clicks, or select a line of text.

I was able to make an automatic logger if i put my code in the "querystatus", but that would be considered bad programming, and it does not log when I simply select a piece of text.

Does anyone know how to make a passive or automatic running code in Visual Studios?

A: 

Unfortunately I think you may need to implement this as a VS Package, which is a much more powerful way to extend Visual Studio. I'd highly recommend looking at the MSDN documentation regarding the "Integration Architecture", it will give you a good idea about the VS extensibility model works and some of the concepts that it uses.

More specifically to your problem, it sounds like you want to extend the Visual Studio editor. There's quite a bit of documentation about extending the editor on MSDN.

Hope this helps!

Matt