Get Assembly version

  • Thread starter Thread starter dinuks
  • Start date Start date
D

dinuks

Hi,

Does anyone know what the simplest way to retrieve the version number
of a referenced DLL is?

Thanks for all the help....

Dinu
 
Does anyone know what the simplest way to retrieve the version number
of a referenced DLL is?

Solution for referenced assemblies:

\\\
With Me.ListView1
.View = View.Details
Dim c1 As New ColumnHeader
c1.Text = "Library"
c1.Width = 140
Dim c2 As New ColumnHeader
c2.Text = "Version"
c2.Width = 80
.Columns.AddRange(New ColumnHeader() {c1, c2})
For Each m As AssemblyName In _
[Assembly].GetExecutingAssembly().GetReferencedAssemblies()

Dim lvi As New ListViewItem
lvi.Text = m.Name
lvi.SubItems.Add(m.Version.ToString())
.Items.Add(lvi)
Next m
End With
///

For the other DLLs, you could use the 'FileVersionInfo' class to get the
files' version numbers.
 
Works like a charm. FileversionInfo was what I was looking for.

Thanks a lot for the help.

Dinu
Does anyone know what the simplest way to retrieve the version number
of a referenced DLL is?

Solution for referenced assemblies:

\\\
With Me.ListView1
.View = View.Details
Dim c1 As New ColumnHeader
c1.Text = "Library"
c1.Width = 140
Dim c2 As New ColumnHeader
c2.Text = "Version"
c2.Width = 80
.Columns.AddRange(New ColumnHeader() {c1, c2})
For Each m As AssemblyName In _
[Assembly].GetExecutingAssembly().GetReferencedAssemblies()

Dim lvi As New ListViewItem
lvi.Text = m.Name
lvi.SubItems.Add(m.Version.ToString())
.Items.Add(lvi)
Next m
End With
///

For the other DLLs, you could use the 'FileVersionInfo' class to get the
files' version numbers.
 
Back
Top