Display Project References

  • Thread starter Thread starter ufgator1978
  • Start date Start date
U

ufgator1978

Hi everyone,

How can I read and then display information (Name, Full Path, and Date
Modified)all of the references in a VB.NET project?

I have been unable to find any information in all of my searching so
any help you can give is greatly appreciated!

Thanks.
 
I should have also mentioned that I'm trying to read them in code and
populate a listview with the information...thanks again!
 
Look at the AppDomain class. You can use
AppDomain.CurrentDomain.GetAssemblies(). Perhaps this will help.
 
Since this is becoming a FAQ, I have written a MSDN Knowledge Base article
about it:

HOWTO: Getting information specific to VB.NET and C# projects from an add-in
or macro
http://support.microsoft.com/default.aspx?scid=kb;en-us;555467

My web site (below) has a section with resources about extensibility, just
in case you need more info.

--

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
 
If he means at run-time or from a compiled assembly, the approach is the
System.Reflection.Assembly.GetReferencedAssemblies.

If he means at design-time from a source code project in the IDE, the
approach is the one of my other post.

--

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
 
Thank you Carlos for your reply....

I am trying to read the project's references at runtime and populate a
listview with information about the reference (Name, Full Path, and
Date Modified). I tried
System.Reflection.Assembly.GetReferencedAssemblies, but
GetReferencedAssemblies was not available in intellisense.

I'm really struggling with this, do you think you could post some code
that will read each of the project's references and just display the
information in a message box? I would be so grateful.

Thanks.
 
Hi,

I don´t know why Intellisense is broken on your IDE but it works for me and
the code is:


Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

Dim objAssembly As System.Reflection.Assembly
Dim objAssemblyName As System.Reflection.AssemblyName

objAssembly = System.Reflection.Assembly.GetExecutingAssembly()

For Each objAssemblyName In objAssembly.GetReferencedAssemblies()
MessageBox.Show(objAssemblyName.ToString)
Next

End Sub
--

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
 

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

Back
Top