Blog Stats
  • Posts - 132
  • Articles - 0
  • Comments - 28
  • 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;
 
        }

 

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati
 

 

Copyright © Richard Jones