0

I have a program in C#, where I want to store the build date and version. The version is added by me, the build date should be automatically generated. Normally if I start the program, there is nothing to do with, but if I add -V option in CMD, I would like to see build date and version. How should I do this?

I need optional arguemnt and somehow get the build date while building it.

Thanks in advance!

PyVas
  • 49
  • 1
  • 6

1 Answers1

0

In general there are two ways to achieve this.

Option 1
Use information that is already present in the assembly like this:
Displaying the build date

Option 2
Define a pre-build event to generate a file (source or ressource) which is compiled into the assembly. This way you can embed any (external) information automatically - for example the svn/git version number.

wischi
  • 666
  • 10
  • 34