Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how do I add a Publish date to a project I'm publishing in vs2010?

Tags:

c#

.net

publish

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

like image 453
aristotaly Avatar asked Dec 29 '22 02:12

aristotaly


2 Answers

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:

  • Displaying the build date
like image 128
Martin Buberl Avatar answered Feb 01 '23 21:02

Martin Buberl


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)

like image 33
Alex Avatar answered Feb 01 '23 20:02

Alex