AssemblyVersionAttribute

O

Oleg Ogurok

Hi all,

According to this document, the auto-generated revision number for an
assembly is the number of seconds since midnight divided by 2. I'm testing
this with my code but the revision comes out 60 minutes ahead.

http://msdn.microsoft.com/library/d...lectionassemblyversionattributeclasstopic.asp

Here's the code:

DateTime now = DateTime.Now;
DateTime jan2000 = new DateTime(2000, 1, 1);
int build = (int)now.Subtract(jan2000).TotalDays;
int revision = (int)now.Subtract(DateTime.Today).TotalSeconds / 2;
textBox1.Text += "assembly version: " +
Assembly.GetExecutingAssembly().GetName().Version.ToString() +
Environment.NewLine;
textBox1.Text += "Build: " + build + Environment.NewLine;
textBox1.Text += "Rev: " + revision + Environment.NewLine;


Here's the output:

assembly version: 1.0.1731.23390
Build: 1731
Rev: 25192

Any ideas on how to properly calculate the Revision number?
Thanks,

-Oleg.
 
R

Richard Blewett [DevelopMentor]

Is it an issue with Daylight Saving?

Regards

Richard Blewett - DevelopMentor
http://staff.develop.com/richardb/weblog

nntp://news.microsoft.com/microsoft.public.dotnet.framework/<[email protected]>

Hi all,

According to this document, the auto-generated revision number for an
assembly is the number of seconds since midnight divided by 2. I'm testing
this with my code but the revision comes out 60 minutes ahead.

http://msdn.microsoft.com/library/d...lectionassemblyversionattributeclasstopic.asp

Here's the code:

DateTime now = DateTime.Now;
DateTime jan2000 = new DateTime(2000, 1, 1);
int build = (int)now.Subtract(jan2000).TotalDays;
int revision = (int)now.Subtract(DateTime.Today).TotalSeconds / 2;
textBox1.Text += "assembly version: " +
Assembly.GetExecutingAssembly().GetName().Version.ToString() +
Environment.NewLine;
textBox1.Text += "Build: " + build + Environment.NewLine;
textBox1.Text += "Rev: " + revision + Environment.NewLine;


Here's the output:

assembly version: 1.0.1731.23390
Build: 1731
Rev: 25192

Any ideas on how to properly calculate the Revision number?
Thanks,

-Oleg.




---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.769 / Virus Database: 516 - Release Date: 24/09/2004



[microsoft.public.dotnet.framework]
 

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

Similar Threads


Top