4

I know I can add a version number to the "help" menu

application.pruductversion

but I do not know how I can add the date when the application was published

Cœur
  • 37,241
  • 25
  • 195
  • 267
aristotaly
  • 399
  • 2
  • 14

2 Answers2

9

If you want to display the build date of your assembly this should do it in the most cases:

public static DateTime GetBuildDate()
{
    UriBuilder uri = new UriBuilder(Assembly.GetExecutingAssembly().CodeBase);
    return File.GetLastWriteTime(
        Path.GetDirectoryName(Uri.UnescapeDataString(uri.Path))
        );
}

There's also another way determining the real compile/build date "the hard way" here on SO:

Community
  • 1
  • 1
Martin Buberl
  • 45,844
  • 25
  • 100
  • 144
1

Use AssemblyInfo file, for more information: AssemblyInfo on MSDN

If you are looking for adding a version number into the add/remove programs menu, you need to modify the msi file using something like SuperOrca or programmatically using something like Phavant MSI (google it)

Alex
  • 2,342
  • 1
  • 18
  • 30