Displaying Version information in Visual Basic ASP.NET 2.0 and 3.5. - More Wally - Wallace B. McClure
in

MoreWally.com

Giving people what they want, More Wally. This is the technical and personal blog site of
Wallace B. (Wally) McClure.

This Blog

Syndication

Technical Sites

More Wally - Wallace B. McClure

This blog will have all kinds of posts about Wally McClure. In it, there will be tons of .NET and computer programming posts as well as Wally's views on life in general. As you might guess, this site and blog help you get More Wally in your life. What more could anyone want? .NET, ADO.NET, ASP.NET, AJAX, Atlas, Microsoft AJAX Library, ASP.NET 2.0 AJAX Extensions, ............

Displaying Version information in Visual Basic ASP.NET 2.0 and 3.5.

I needed to display the application version in a file based ASP.NET 3.5 application written in Visual Basic.  I wrote the following methods in my AssemblyInfo.vb file in the App_Code directory and it worked! Out popped the Version Number of 1.0.0.10 instead of that annoying 0.0.0.0. 

Imports System
Imports System.Reflection
Imports System.Runtime.InteropServices

' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.

' Review the values of the assembly attributes

<Assembly: AssemblyTitle("blah")>
<Assembly: AssemblyDescription("blah")>
<Assembly: AssemblyCompany("blah")>
<Assembly: AssemblyProduct("blah")>
<Assembly: AssemblyCopyright("2005, 2006, 2007, 2008")>
<Assembly: AssemblyTrademark("")>
<Assembly: CLSCompliant(True)>

'The following GUID is for the ID of the typelib if this project is exposed to COM
<Assembly: Guid("BCB55B59-EA39-4C62-BFFE-DE7800B420C8")>

' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Build and Revision Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("1.0.0.10")>

Public Class AssemblyInfo
    Public Shared Function GetVersionNumber() As String
        Return (System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString())
    End Function
End Class

Published Jul 15 2008, 06:21 PM by admin
Filed under: ,

Comments

No Comments
2006 - Wallace B. McClure
Powered by Community Server (Non-Commercial Edition), by Telligent Systems