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

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.