Wednesday, March 16, 2011

Can I get the success/failure of a task into a property if ContinueOnError="true" is used?

I'm executing a task in msbuild:

<MyTask ContinueOnError="true" OtherParam="Cheese"/>

<PropertyGroup>
  <MyTaskResult>????how do I set this????</MyTaskResult>
<PropertyGroup>

I want to get the result of MyTask into a property (it's Execute method returns a bool) so I can test it and conditionally do stuff. Is this possible?

Thanks.

From stackoverflow
  • You could modify your task to put its results in an output parameter.

    Scott Langham : Thanks, yes, you're right. Phew, good job I've got the source code. I'm surprised there doesn't seem to be any other way.

0 comments:

Post a Comment