Scott Bryen wrote:
Does any one know of how to get the build date and time when there is a successful build?
Basiclly i want to retun the build date and time to a label on an about box.... is this possible?
I know there are post build events but im not sure what u do with these and perhaps it could be done there?
be greatful if any one coudl help.
Thanks a lot.
Scott B.
I'm not convinced a post build event would help you. By its nature it's something that fires after a compile, which is then too late to change the contents of a label.
You could do a prebuild event which would edit your about box source file accordingly to put the time and date in. Of course if the build fails, well, that portion is still changed. So what you'd want to do is copy the original file somewhere first, then, if the build fails, copy it back.
<Target Name="BeforeBuild">
<Exec Command="myReplaceCommand.exe />
</Target>
would be the easiest way to start, compiling your own little exe to run. A better option would be a custom msbuild task ....