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

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:
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.
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.
The events I'd like to be able to handle are things like, the opening/closing/editing/creating/deleting of Solutions / Projects / individual files.
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!

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.

You want:
Visual Studio Extensibility Developer Center
VSX Forum
Visual Studio 2008 SDK
Professional Visual Studio Extensibility by Keyvan Nayyeri
Buy the book, if nothing else.

Related

Dataset production using SQL Server Management Studio, Visual Studio Code, Azure Data Studio, Visual Studio

I regularly use SSMS to query data and build datasets, my IT department handle the database administration.
Recently I found out about Azure Data Studio and I liked:
intellisense
source code control (e.g. with Git)
extensions from the community
SQL snippets, automating code writing and are even customisable
Notebooks - the ability to run code alongside comments in markdown. Amazing for live documentation. It enables you execute code in different languages on the same page!
In addition to this I see Visual Studio Code (and Visual Studio). VS Code and ADS seem so similar especially once you add in extensions. The overlap between the products is confusing.
I don't have SQL Server 2019 and Big Data Clusters. I am looking for a program that has notebook functionality in SQL, R and Python. Although it seems like there are better products for developing R code e.g. R studio.
I'd like to be trying alternatives to SSMS to establish different future work flows. At the moment it feels hard to wholeheartedly recommend any options.
Does anyone have a good any idea about how this all fits together?
EDIT: If you've tried to find out Microsoft's strategy but are pretty bemused, responses are also welcome!
Azure Data Studio is derived from Visual Studio Code or I prefer to say it is a clone of VS Code. It comes with the same aspects that VS Code has comparing to the IDE Visual Studio.
It is free, open source, and cross-platform tool.
ADS is seeing some success thanks to the support of Git, work-spaces, notebooks, and extensions. The product seems to have a promising future like Visual Studio Code.
"In addition to this I see Visual Studio Code (and Visual Studio). VS Code and ADS seem so similar especially once you add in extensions. The overlap between the products is confusing." There is no overlap. ADS is dedicated for Data/AI mainly and not for coding. They share a lot of features because ADS is a clone of VS Code. For example, Visual Studio also has SQL Server Explorer, but is not overlapping with SSMS.
" Although it seems like there are better products for developing R code e.g. R studio." Each product has pros and cons, it is hard for me to compare R studio with ADS. One is dedicated for one prog.language mainly and the other one works with t-sql, PostgreSQL, PowerShell and Jupyter notebooks .
Personally, as software/data engineer, I have been using ADS for more than 1 year alongside SSMS, VS code and Visual Studio. They are all complementary to each other.

Visual Studio Add-in: How to get selected items in window

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.

How does VSTO work in Visual Studio 2010?

Few question about VSTO project I don't understand:
Registration - unlike native Office Plugin, where I've an installation project, how does the deployment work in managed add-in? After building the project, I do have the necessary entries in the registry that define the plugin (HKCU\Software\Microsoft\Office\Outlook\Addins...). Where is the code that perform this registration?
Also, why in the HKCU? I'd like the plugin to be defined for all users (in HKLM). How do I change that?
How does Visual Studio know to start Outlook, when I press F5? In the property page for the project, under the debugging tab, the 'Start Option' is set to 'Start project'. Who tells Visual Studio that starting the project means starting Outlook?
Looking for more materials about VSTO. Can you recommend a resource?
A few answers
1. Basically the same for a managed project except that the Reg entries point to the .MANIFEST file, which in turn identifies the dll of the addin assembly.
Ohhh. this is a LONG story, there's lots of info on the web about it. Google "registering an addin for all users".
Short version is that it's possible, but requires some really weird and difficult to explain registry shinanigans.
If you've created an Outlook addin property, then by virtue of that project type, VS knows what to do on start.
I've never found a good definitive source for vsto material. Google's been my best friend for that kind of info. Andrew Coates has a pretty decent list here though
http://blogs.msdn.com/b/acoat/archive/2007/08/02/vsto-resources.aspx
I have no explicit information but currently I'm working through http://msdn.microsoft.com/en-us/library/ff937654.aspx which so far has been a great source of information. Please let me know if this worked out for your Outlook project.

Disabling Team Foundation Server extensions in VS2010

We're using Visual Studio 2010 (Premium edition if it matters), and pretty happy with it. However, We're never going to use the TFS features that's included in the IDE. (We're using Jira and Subversion, as it's not just Visual Studio that we work with, but also IntelliJ and a couple other IDE's.)
Is there any way to disable the TFS portions of the IDE? It's not a big deal or anything, just for the sake of "keeping things neat."
In Visual Studio 2010, go to Tools->Options In the list, select Source Control. Set your Current source control plug-in: to None
The main "TFS" parts of the IDE are in Team Explorer - Just don't install it.
Anything else you don't want/use, I'd advise you to simply ignore - VS has support for hundreds or even thousands of different things that you will probably never use, and you can't easily "clean" them all away.
In my experience the more you alter your installation of Visual Studio the more problems you will have with it. Every custom Option you set is another thing you have to repeatedly set every time you get a new PC or install a new VS. (Although it has improved a lot since import/export options became available and reliable). I used to spend about half a day setting up a visual studio to "work well", and now I just install it and use it. Ultimately I found that it was easier to just adjust my working practices (e.g. by relearning a few keyboard shortcuts etc) than to try to bend VS to my will.

What is Visual Studio 2010 going to look like?

I have heard several podcasters (most recently the guys on DotNetRocks) say that the look and feel of Visual Studio 2010 has been completely redesigned and Visual Studio rewritten in WPF.
I have been watching some demos on channel9 of the Visual Studio 2010 CTP and the only thing that looks different to me is the opening screen.
I read the notice on MSDN, but it doesn't say anything about the look/design of Visual Studio.
Has Microsoft reversed direction on this or are there going to be major changes made to UI of the final product?
I'm guessing 3D with a space theme. You'll be able to "fly through" your code, "orbiting" classes, "shooting down" bugs and "launching" your code.
It's way too soon to make guesses about what it will look like: I don't even think that they know what it will look like.
However, from what I've heard, they are in fact rewriting portions to be WPF/C#, but they are not throwing everything out and starting from scratch. Instead, they will be rewriting portions as it makes sense. For example, I saw that they have some new UML tools that definitely look to be done in WPF.
Uh, the beta has been available for over a month. I have been playing with Visual Studio 2010 on and off. It is very similar to 2008 in overall design.
You can download it here and see for yourself where they are taking the product:
Download Page at Microsoft.com
There are a metic ton of videos on Channel9 about VS2010, TFS 2010 and then the PDC 2008 sessions online as well. They are also starting a new series called 10-4 dedicated just to VS2010 - a walk through of sorts.
Let's pray that they don't dink with anything, visually. My #1 guess is that they'll try and wrap the new office ribbon bar around our necks. ;|
I've heard that its going to have a historical debugger.
Also- this should prob be a wiki
From WPF Wonderland:
Visual Studio 2010 gets WPF facelift
WPF has been out for a couple years. That’s long enough that new releases of Microsoft products are sprouting WPF interfaces.
Last year at PDC Microsoft announced that the code editor in Visual Studio would be re-written in WPF. Microsoft didn’t stop at the code editor though. Today Jason Zander, GM for Visual Studio, revealed the new WPF based IDE.
Highlights from the PDC Keynote #1 on Day 2 (see: PDC website)
Multi-monitor support for the IDE via
WPF.
Building classes from test classes.
Toggle TFS bugs over a code segment
in Debug mode.
Partial config files for debug,
release.
WYSIWYG Silverlight Designer.

Resources