I want to extend the extension manager in Visual Studio 2010. I'd rather know if that is at all possible before I get into it, but am unable to find anything about it.
All the extensibility options I've read about mention nothing about being able to actually change the function of an existing VS2010 tool like the extension manager.
I'd appreciate any relevant links.
There are no supported interfaces for extending the Extension Manager in Visual Studio 2010.
What specifically did you have in mind though? Perhaps there's some other way you can accomplish what you're trying to do...
Related
I use Visual Studio for everyday work and I would like to have similar functions to Rider/ReSharper. Specifically, I was wondering if it was possible to make sure that when I press F12 on a .NET object I see the source code. For libraries downloaded from NuGet it works but not for .NET objects. Also I would like to have the real-time IL code generated by Roslyn.
Thanks everyone for your replies.
Can I create an extension for Visual Studio that runs in the background as soon as the user opens the Visual Studio IDE? For example, I am building an extension that gets the current active file address in Visual Studio (with C#), but I would like this extension to always run in the background without having to be activated by the user clicking a button or pressing some key combination.
Is this possible, and if so, what is the best way of doing it?
Any help would be greatly appreciated! Regards, Erfan
Since you tagged your question with visual-studio-2010 I assume you are working on an "Add-in" rather than a "VSPackage Extensions".
In this case, you can use the OnConnection event handler.
If you are working on a VSPackage Extensions, you can use the attribute ProvideAutoLoad.
Just search for these, you will find sufficient information. Both ways are also described shortly here under "How can I run my add-in code in a VSPackage?"
For Extension add following attribute to Package class, this will load the extension when a solution is not open in visual studio. I have tested this with VS 2015 and 2017.
[ProvideAutoLoad(UIContextGuids80.NoSolution)]
For VS 2010 and higher the recommended extensibility approach is a package (VS 2015 won't allow add-ins).
To get the package loaded when Visual Studio is loaded see HOWTO: Autoload a Visual Studio package.
Once loaded, your package may be interested in two different kind of selection change events:
To get notified when the selection in the Solution Explorer changes, get the IVsMonitorSelection interface and call the AdviseSelectionEvents/UnadviseSelectionEvents and provide a class that implements the IVsSelectionEvents interface.
To get notified when the active window changes (which can be a document window or a toolwindow), implement the IVsWindowFrameNotify interface.
Let a "Breakpoints" window (by default opened by Debug>Windows>Breakpoints [ctrl+B, D]) serve as an example. Basically I select few breakpoints in it and I would like to know in my add-in which elements in this window are selected. I am aware that I can get collection of breakpoints in project but I would like to know what elements are selected in "Breakpoints" window.
"Is it possible to get selected items in window or even access its content at all?"
Also I am not sure whenever or not should I post a separate question for this but is there actually a way to capture user activity in IDE like for example capturing an event when user sets (adds) a breakpoint?
Originally I also asked if is it possible to achieve certain things in Visual Studio Express Edition. But this part is irrevelant.
Conclusion:
(after reading jessehouwing's answer)
I guess it is not possible using an Add-ins. Use VSPackages isntead. Also Add-ins are deprecated as of Visual Studio 2013 version.
As mentioned in my comments, what you're trying to accomplish is explicitly prohibited in the Visual Studio Express edition and is a violation of it's license. To extend the product, you need to have at least Visual Studio Professional Edition. many of the extensibility points will actively refuse any communication with 3rd party add-ins.
Almost all the things you're asking are possible using Visual Studio Extensibility once you've installed the professional edition. Products like OzCode show that almost everything is possible. Remember that most features inside visual studio are themselves extensions of the product.
Your question, indeed a whole list of questions, is indeed not the way to ask something on StackOverflow. I can give you some pointers to the documentation, which you've probably already found, and maybe to some open source products that themselves extend parts of Visual Studio that can serve as examples, but from there you'll have to piece something together until you're able to ask more specific questions.
Events you can subscribe to, the breakpoints are a CommandEvents I suspect.
Manipulating windows inside Visual Studio
Projects that extend the debugger that might serve as an example:
PyTools (debugger for Python inside Visual Studio)
Node.js tools for Visual studio (extending the Immediate Window)
But there is no easy answer to your question that fits inside this window. I'd suggest you use a tool like Reflector to look at how Microsoft accomplishes certain things (most of Visual Studio Extensibility is written in .NET anyways) and to look at open source projects that extend visual studio behavior. There are quite a few out there on Codeplex.
I'm not entirely sure what you're trying to accomplish and how it's different from the Breakpoints features inside Visual Studio Professional and up.
I suggest you ask your question in the Visual Studio Extensibility forums over on MSDN, which is in a collaborative forum format, instead of a Q&A format, allowing people to answer your question bit by bit.
Does anyone know about a plugin (or built-in) functionality for quickly switching Visual Studio Solutions?
I'm working in a multi-solution project and need to switch the solution quite often (by reusing one of the open Visual Studio instances)
Any ideas?
If not, how hard would it be to write a plugin on my own?
You can add solutions to favorite links with my Favorite Documents extension.
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?
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!