P
Phil Galey
I created an About box and am able to get all the assembly information from the program to show up in the About box except the Version.
I created the About box as a separate Windows application, changed the Output to Class Library, and compile it as a DLL. I then reference it from my program. In the About Box form's Public Sub New routine, I placed the following code, where I'm getting all the assembly attributes from the calling assembly. The problem is all attributes are coming in fine, except the Version attribute. For some reason the AssemblyVersionAttribute object doesn't exist in the assembly. How can I make sure the AssemblyVersionAttribute will be present like the others? Thanks.
-----------------------------------------------------------------------------------------------
mAssy = Reflection.Assembly.GetCallingAssembly
Dim aTitleAttr As AssemblyTitleAttribute = _
AssemblyTitleAttribute.GetCustomAttribute( _
mAssy, GetType(AssemblyTitleAttribute))
Me.Text = "About " & aTitleAttr.Title
lblTitle.Text = aTitleAttr.Title
Dim aCopyRight As AssemblyCopyrightAttribute = _
AssemblyCopyrightAttribute.GetCustomAttribute( _
mAssy, GetType(AssemblyCopyrightAttribute))
lblCopyrightInfo.Text = aCopyRight.Copyright
Dim aDescription As AssemblyDescriptionAttribute = _
AssemblyDescriptionAttribute.GetCustomAttribute( _
mAssy, GetType(AssemblyDescriptionAttribute))
lblDescription.Text = aDescription.Description
Dim aVersion As AssemblyVersionAttribute = _
AssemblyVersionAttribute.GetCustomAttribute( _
mAssy, GetType(AssemblyVersionAttribute))
lblVersion.Text = aVersion.Version
---------------------------------------------------------------------------------------------
I created the About box as a separate Windows application, changed the Output to Class Library, and compile it as a DLL. I then reference it from my program. In the About Box form's Public Sub New routine, I placed the following code, where I'm getting all the assembly attributes from the calling assembly. The problem is all attributes are coming in fine, except the Version attribute. For some reason the AssemblyVersionAttribute object doesn't exist in the assembly. How can I make sure the AssemblyVersionAttribute will be present like the others? Thanks.
-----------------------------------------------------------------------------------------------
mAssy = Reflection.Assembly.GetCallingAssembly
Dim aTitleAttr As AssemblyTitleAttribute = _
AssemblyTitleAttribute.GetCustomAttribute( _
mAssy, GetType(AssemblyTitleAttribute))
Me.Text = "About " & aTitleAttr.Title
lblTitle.Text = aTitleAttr.Title
Dim aCopyRight As AssemblyCopyrightAttribute = _
AssemblyCopyrightAttribute.GetCustomAttribute( _
mAssy, GetType(AssemblyCopyrightAttribute))
lblCopyrightInfo.Text = aCopyRight.Copyright
Dim aDescription As AssemblyDescriptionAttribute = _
AssemblyDescriptionAttribute.GetCustomAttribute( _
mAssy, GetType(AssemblyDescriptionAttribute))
lblDescription.Text = aDescription.Description
Dim aVersion As AssemblyVersionAttribute = _
AssemblyVersionAttribute.GetCustomAttribute( _
mAssy, GetType(AssemblyVersionAttribute))
lblVersion.Text = aVersion.Version
---------------------------------------------------------------------------------------------