Getting last builddate in applcation

  • Thread starter Thread starter Andrus
  • Start date Start date
A

Andrus

I want to get last solution build date from my application code in format
yyyymmdd in application created by VWD 2008 Express

Currently I have hard coded string

static readonly string version = "20090615";

but forget to update it at every build.

How to get last build date from application witohut manally updating code
before each build ?

Andrus.
 
Use a FileInfo object and point it to your applications executable. FileInfo
has this information.
 
Andrus said:
I want to get last solution build date from my application code in format
yyyymmdd in application created by VWD 2008 Express

Currently I have hard coded string

static readonly string version = "20090615";

but forget to update it at every build.

How to get last build date from application witohut manally updating code
before each build ?

Let the C# compiler increment the version for you, it encodes the build date
and time into the assembly version.

http://www.geekproject.com/showtopic.aspx?ID=21
 
How to get last build date from application witohut manally updating code
Let the C# compiler increment the version for you, it encodes the build
date and time into the assembly version.

http://www.geekproject.com/showtopic.aspx?ID=21

Thank you.
In AssemblyInfo.cs I changed lines to

[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyFileVersion("1.0.*")]

and re-build solution.
Now in Windows Explorer Properties Details shows

File version: 1.0.0.0
Product version: 1.0.*

So it is not working.
How to get this working ?

If we got this work how to create method in this assembly which converts
build number (number of days from 2000
according to decription) to build date ?

Andrus.
 
Is'nt Fileinfo changed to save date if assembly is loaded from web to save
date ?
I need build date, not date when file was last saved.

Andrus.
 
[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyFileVersion("1.0.*")]

and re-build solution.
Now in Windows Explorer Properties Details shows

File version: 1.0.0.0
Product version: 1.0.*

So it is not working.
How to get this working ?

I got this working in VWD2008 Express by removing AssemblyFileVersion line
from code at all.
Now File properties shows build number which according to link is day number
from year 2000.

MSDN states that that this attribute should not used in application code.

How to get build this number and convert it to date in this assembly static
class method ?

Andrus.
 
Andrus said:
[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyFileVersion("1.0.*")]

and re-build solution.
Now in Windows Explorer Properties Details shows

File version: 1.0.0.0
Product version: 1.0.*

So it is not working.
How to get this working ?

This works for me:
[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyFileVersion("1.0.0.0")]

I'm checking the .NET metadata with .NET Reflector, the version is correct
there.

Windows Explorer doesn't read the .NET metadata but the old VERSION resource
instead, and apparently that isn't updated. So ignore what Explorer says.
I got this working in VWD2008 Express by removing AssemblyFileVersion line
from code at all.
Now File properties shows build number which according to link is day
number from year 2000.

MSDN states that that this attribute should not used in application code.

How to get build this number and convert it to date in this assembly
static class method ?

Assembly.GetEntryAssembly().GetName().Version

or use the executing assembly or current assembly, if the date you want is
from a library and not the main .exe
 
Back
Top