Im getting some attributes from the assembly and I cant seem to get the version attribute. When I use the following code it throws an out of bounds exception for the array as there are no elements.
The AssemblyVersion attribute is defined and this code works perfectly for every other assembly attribute. Any thoughts on this?
The AssemblyVersion attribute is defined and this code works perfectly for every other assembly attribute. Any thoughts on this?
Code:
Public ReadOnly Property Version() As String Implements IAssemblyInformation.Version
Get
Get the version attribute
Dim attrVersion As AssemblyVersionAttribute
attrVersion = CType(myAssembly.GetCustomAttributes(GetType(AssemblyVersionAttribute), False)(0), AssemblyVersionAttribute)
Return the version string
Return attrVersion.Version.ToCharArray
Clear any objects we used
attrVersion = Nothing
End Get
End Property