I want to show Build On date in About message box, current i’m using File.LastWriteTime (Assembly.GetEntryAssembly(). Location).
//But facing an issue with this approach. Build time comes the time when i installed my app.
E.g. on 1st jan, i created a build and then run .exe on 7th jan to install it. Build on date comes 7th jan not 1stJan.
Any ideas ?
You can create your own
AssemblyBuildTimestampAttributeand use it just like theAssemblyVersionAttributeis used so that you can tag your builds with a version and also with a timestamp.If you just need the date part and not the time and also want it to be managed automatically you can change the version attribute to something like
AssemblyVersion("1.2.*"). The asterisk means that the build and revision numbers will be generated automatically. If I recall correctly the default build number is the number of days elapsed since January 1, 2000 so this allows you to do some math and obtain the day the assembly was built.