I'm trying to retrieve the version attribute of the current assembly in
Console and Service applications. I've tried the following method but it
doesn't work for me. Any ideas:
' Return the assembly's Version attribute value.
Public Function GetAssemblyVers ion() As String
Dim m_MyAssembly As [Assembly] = [Assembly].GetExecutingAs sembly
If m_MyAssembly.Is Defined(GetType (AssemblyVersio nAttribute), True) Then
Dim attr As Attribute = _
Attribute.GetCu stomAttribute(m _MyAssembly,
GetType(Assembl yVersionAttribu te))
Dim version_attr As AssemblyVersion Attribute = DirectCast(attr ,
AssemblyVersion Attribute)
Return version_attr.Ve rsion.ToString
Else
Return ""
End If
End Function
TIA
Russ