How to get assemblies referenced in current project in design time

G

Guest

am looking for a way, during design-time, to be able to access all
assemblies that were added as references to the currently selected project.

That would allow me, for instance, to open a control editor and populate a
list box with the names of all assemblies referenced by the project that the
control is part of.

I checked the available design-time services like ITypeResolutionService and
IReferenceService and none of them seem to be useful for that purpose.

So how I can do it?

Thanks,
Marcos
 
C

Carlos J. Quintero [.NET MVP]

From an add-in that would be done with the assemblies EnvDTE.dll and
VSLangProj.dll, using the root EnvDTE.DTE object (the IDE), you get the
EnvDTE.Project, cast its Object property to VSLangProj.VSProject and then
you get the References collection.

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com
 
G

Guest

Thanks. I actually found out how to do it yesterday in the web and the
solution corresponds exactly with the explanation you just gave me. I
implemented it and it worked as expected.

Thanks again,
Marcos
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top