Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I'm getting some attributes from the assembly and I can't 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?

 

       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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...