You can change the version of the assembly to encode the date, but that would probably mean losing subversion revision information, which might be more useful.
This should work: write the current date / time to a .cs file as a pre-build task as follows:
[assembly: AssemblyCreated(CreatedDate = new DateTime(...))]
To do this, you can use the PowerShell script command file or the executable file.
Include the file in your project (compile action: compile) and include the user attribute:
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)] public sealed class AssemblyCreatedAttribute : Attribute { public DateTime CreatedDate { get; set; } }
When you start the application, you can use reflection to get a custom attribute from the assembly to display on the about page.
source share