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

 

Tuesday, May 26, 2009

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;
 
        }

 

 

 

Copyright © Richard Jones