1
Reply

How to get all referenced assemblies?

    To Display the list of referenced assemblies

    Imports System.Reflection

    Private Sub PopulateListView()

    'Get a list of referenced assemblies

    Dim assemblyNames() As System.Reflection.AssemblyName = [Assembly].GetExecutingAssembly.GetReferencedAssemblies

    Dim assemblyName As System.Reflection.AssemblyName

    Dim listViewItem As System.Windows.Forms.ListViewItem

    Dim i As Integer

    'Add each assemblies information to the listview

    For i = assemblyNames.GetLowerBound(0) To assemblyNames.GetUpperBound(0)

    assemblyName = CType(assemblyNames.GetValue(i), System.Reflection.AssemblyName)

    listViewItem = New System.Windows.Forms.ListViewItem

    listViewItem.Text = assemblyName.Name

    listViewItem.SubItems(1).Text = assemblyName.Version.ToString

    listView.Items.Add(listViewItem)

    Next i

    End Sub

    http://kalitinterviewquestions.blogspot.com/