While working with a test team, today, we were doing incremental builds of a Compact Framework application.
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;
}