I'm creating a Visual Studio 2010 extension package (Microsoft.VisualStudio.Shell.Package
) that needs to analyze all of the projects and those project's references. I would assume that this is done with a service (e.g. Package.GetService(typeof(IMenuCommandService))
). What I need is the interface that contains the functionality to get a list of projects and references for those projects. Also, any advice on where to find a reference that contains the available interfaces within visual studio would be much appreciated.
Note that I've seen multiple people trying to do something similar using DTE from a macro. That's not what I'm trying to do. I'm trying to do the same thing from within a Visual Studio Extension.
So even though you're doing this as part of an extension, you'll still need to use the DTE APIs to get all of the information you want. It may seem backwards but that's just how it works. You should grab the DTE object via (EnvDTE.DTE)Package.GetService(typeof(SDTE))
. Once you have a EnvDTE.Project, access it's Object member and cast that to a VSLangProj.VSProject if it's a C# or VB project. This has the reference information you need.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With