472,978 Members | 2,088 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,978 software developers and data experts.

Determining 'Build' date of a solution

Hey gang,

What's the best way to implement a Build version (or "last updated"
date) in my web-app? I have a footer in my master page that displays
the application's name and copyright info etc. I'd like to add a Build
version and build date as well. (Without hardcoding it obviously.)

At first I thought I'd just take the timestamp of the web.config, but
my web.config doesn't change that much. Is there an easy way to
determine what day the entire web-app was built? (or deployed might be
more accurate.)

My web solution is fairly large, about 40 aspx pages, and 12
class-library projects -- so perhaps I should start thinking about
implementing a versioning regime as well.

Any thoughts on this? Thanks.

Roger

Nov 19 '05 #1
2 1817
Roger,
Here's how you would get the build version:

System.Reflection.Assembly asm =
System.Reflection.Assembly.GetExecutingAssembly(); // Get our assembly;
System.Version version = asm.GetName().Version;
string build = version.ToString(); //

To get the date, you can do it this way, but you have to set the correct
FileIOPermissions;

System.IO.FileInfo inf = new System.IO.FileInfo(asm.Location); // get the
location of our executing assembly
DateTime dt = inf.LastWriteTime();
string buildDate = dt.ToString();

Hope that helps.

Dave

"Roger Helliwell" <rh********@telus.net> wrote in message
news:7o********************************@4ax.com...
Hey gang,

What's the best way to implement a Build version (or "last updated"
date) in my web-app? I have a footer in my master page that displays
the application's name and copyright info etc. I'd like to add a Build
version and build date as well. (Without hardcoding it obviously.)

At first I thought I'd just take the timestamp of the web.config, but
my web.config doesn't change that much. Is there an easy way to
determine what day the entire web-app was built? (or deployed might be
more accurate.)

My web solution is fairly large, about 40 aspx pages, and 12
class-library projects -- so perhaps I should start thinking about
implementing a versioning regime as well.

Any thoughts on this? Thanks.

Roger

Nov 19 '05 #2
On Fri, 29 Apr 2005 09:39:21 -0500 in
microsoft.public.dotnet.framework.aspnet, "David Young"
<RE******************@yahoo.com> wrote:
Roger,
Here's how you would get the build version:


Thanks David -- I'll give it a whirl.
Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Shawn Wilson | last post by:
Hi, My host keeps messing things up and not telling me. I am trying to write a cron job that will test to make sure the "unusual" functions I use work and, if not, email me. I want it to send...
8
by: Joshua Beall | last post by:
Hi All, I am wondering what the best way to determine an age of something/somone is. For instance, let's say I have two dates: 1985-07-19 2003-11-30 Now, I want to determine the interval...
10
by: CJM | last post by:
I have a bit of code which involves some looping... In each iteration, we retrieve a string value... I want to build a list of DISTINCT (in the SQL sense) string values. Our example strings...
0
by: Igor | last post by:
Hi all! As many of you, I have a big VB.NET solution and quite often get bogus build errors out of the blue. This isn't declared, that is not a property of some shit and so on... It's very...
5
by: cameron | last post by:
Is it possible to get the build date, (not the version), of a dll? -Cam
7
by: dm_dal | last post by:
I have a solution in VS.Net 2003. It contains 1 - asp.net project(c#), 1 - c# class library project and 1 - db project. When I try to build the solution, I get the following error: Could not...
3
by: musosdev | last post by:
Hi guys Okay, I've setup my projects to open and compile fine in VS2005 using FPSE and remote web, but it's *really* slow. So I thought I'd have a go at doing it the normal way, by loading from...
2
by: Pieter | last post by:
Hi, How can I knwo the BuildDate from an application distributed by ClickOnce? When I use "System.IO.File.GetLastWriteTime(objAssembly.Location)" or...
4
by: Nathan Sokalski | last post by:
When determining whether a String can be converted to a DateTime, you can use the IsDate() method. However, I would also like to know whether the string is a date, a time, or both a date and a...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.