Build Numbers in ASPX Pages

N

nautonnier

This may have been covered before but I didn't find anything after
doing a google search.

Does VS.NET 2005 have a way to put build or version numbers within
aspx pages? I'm envisioning an attribute on the page directive or
maybe its own tag. This would be a tremendous help to keep track
whether an application install is the latest version of any particular
page and not just the dll.

Thanks for any ideas,

nautonnier

PS, In case there's any confusion, I'm looking at an automatic way to
do this and not just manually putting in a tag and updating the number
each time a developer updates it (we all know how much we developers
love to update comments).
 
J

JJ

The closest I've come with this is using visual source safe version numbers?
Not sure if thats any help or not?

You basically have to turn on this feature in SourceSafe and the following
keywords in a code file are replaced:

$Archive: $
VSS archive file location

$Author: $
User who last changed the file

$Date: $
Date and time of last check in

$Header: $
Logfile, Revision, Date, Author

$History: $
File history, VSS format

$JustDate: $
Date, without the time addendum

$Log: $
File history, RCS format

$Logfile: $
Same as Archive

$Modtime: $
Date and time of last modification

$Revision: $
VSS version number

$Workfile: $
File name



If this is what you are after, but are still confused, post back and I'll
dig up a working example.

Hope this helps,

JJ
 
M

Mike Hofer

This may have been covered before but I didn't find anything after
doing a google search.

Does VS.NET 2005 have a way to put build or version numbers within
aspx pages? I'm envisioning an attribute on the page directive or
maybe its own tag. This would be a tremendous help to keep track
whether an application install is the latest version of any particular
page and not just the dll.

Thanks for any ideas,

nautonnier

PS, In case there's any confusion, I'm looking at an automatic way to
do this and not just manually putting in a tag and updating the number
each time a developer updates it (we all know how much we developers
love to update comments).

I didn't have any problems obtaining the version information
whatsoever. I used Reflection to get it.

Here's the class I whipped up to obtain it:

Option Explicit On
Option Strict On

Imports System.Diagnostics
Imports System.Reflection

Public Class VersionInfo

Public Sub New()
m_assembly = Reflection.Assembly.GetExecutingAssembly()
GetVersionInfo()
End Sub

Public Sub New(ByVal [assembly] As Reflection.Assembly)
m_assembly = [assembly]
GetVersionInfo()
End Sub

Private Sub GetVersionInfo()
m_version = m_assembly.GetName().Version
m_fileversion =
FileVersionInfo.GetVersionInfo(m_assembly.Location)
End Sub

Private m_assembly As Reflection.Assembly
Public ReadOnly Property [Assembly]() As Reflection.Assembly
Get
Return m_assembly
End Get
End Property

Private m_fileversion As FileVersionInfo
Public ReadOnly Property FileVersion() As FileVersionInfo
Get
Return m_fileversion
End Get
End Property

Private m_version As Version
Public ReadOnly Property Version() As System.Version
Get
Return m_version
End Get
End Property

End Class

I suggest instantiating it with the default constructor. If you so
choose, you can pass it a different assembly, and it will report the
version information for that assembly as well, provided that you have
sufficient permissions to the folder where it resides.

This will give you the file and assembly version information for your
executing assembly (usually, the DLL). Now, if you're using a multi-
dll project, you'll want to iterate over the various DLLs in the
project. If that's your case, get back to me, and we'll go over that
as well.

Hope this helps.

Mike Hofer
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top