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?


LastWriteTime shows the time when the assembly was written to disk, and that is the moment of updating. Perhaps GetCreationTime.

Other than that, try this