Posted By: Scott Bryen | Jun 21st, 2006 @ 5:10 AM
page 1 of 1
Comments: 5 | Views: 2719
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.

blowdart
blowdart
Peek-a-boo
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 ....
blowdart
blowdart
Peek-a-boo
Scott Bryen wrote:
How do i build ms build tasks?... Any good tutorials around? the reason i thought post build because then u can determine wether the build is successful or not.

Scott B


Well if it's not successful there is no output Smiley

You build your own tasks by inheriting from Microsoft.Build.Utilities.Task and implementing the Execute method. Easy Smiley

http://blogs.msdn.com/msbuild/archive/2006/01/21/515834.aspx

is a good starting point.
blowdart
blowdart
Peek-a-boo
Scott Bryen wrote:
Ok i have made a tasks to run but where the hell do i run it from... it sas your project file but i cant find no project file to lauch it from ?... btw im using express edition if that makes a difference.


Oh! I don't know Express at all. Is there a .csproj file for your project? That would match up to VS2005 and would be your build file.
page 1 of 1
Comments: 5 | Views: 2719
Microsoft Communities