How do I get Version Information From The AssemblyInfo File?
To get version information at Runtime in VB .NET, use the following code:
Function Version() As String With _
System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetExecutingAssembly.Location)
Return .FileMajorPart & "." & .FileMinorPart & "." & .FileBuildPart & "." & .FilePrivatePart
End With
End Function
Function Display() As String
With System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetExecutingAssembly.Location)
Return .Comments
End With
End Function
Upon running the version information of the Assembly file is displayed.
Written by Sandeep Mogulla, Webmaster at
www.startvbdotnet.com
Index