Blog Stats
  • Posts - 95
  • Articles - 0
  • Comments - 19
  • Trackbacks - 0

 

Build Time

While working with a test team, today,  we were doing incremental builds of a Compact Framework application.

 

image

We wanted to display the build time of each release of software,  so that the test team could be sure we were all using the current version.

This tiny bit of code achieves just that.

 public static DateTime BuildTime()
        {
            Assembly assembly = Assembly.GetExecutingAssembly();
            string filename = System.Reflection.Assembly.GetCallingAssembly().GetName().CodeBase;
            FileInfo info = new FileInfo(filename);
            return info.CreationTime;
 
        }

 


Feedback

# re: Build Time

Gravatar Not to be picky but is the first line necessary? You don't seem to use the executing assembly?

Keep up the good work with the blog! 5/27/2009 8:35 AM | Andrew Butler

# re: Build Time

Gravatar Gosh your right.. Even more minimal!

Thanks Andrew 5/27/2009 11:26 AM | Richard

# re: Build Time

Gravatar Just tried this out. Deploying via cab file. Seems to work on Motorola MC70 (WM5) but MC75 (WM6.1) seems to reset Creation time to the time it was deployed? 6/23/2009 6:58 AM | Robin

Post a comment





 

 

 

 

Copyright © Richard Jones