Click here to Skip to main content
15,882,113 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello,

I need to display last released version date in my application. I am displaying last build/compiled date as version date with below code.

DateTime buildDate = new FileInfo(Assembly.GetExecutingAssembly().Location).LastWriteTime;
lbldate.Text = buildDate.Date.ToString("dd/MM/yyyy");


but if I update the live server with latest code other than today, then it is displaying the date when we update the server with latest code instead last build/compiled date.

one another que, Is code compile on live server? that's why it is displaying that date.

is there any way to display last build/compiled date as release date?

Thanks,
KK
Posted

1 solution

The value you are reading is the last modification time of the OS, not connected to the build date!
The assembly do contain the build date, but it's not public and there is no easy way to retrieve it...
but there is a hard...[^]

IMHO - you better use version number...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900