473,385 Members | 1,877 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 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 1839
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

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.