Find out the reason why a BuiltIn function in c# is returning false

61 Views Asked by At

How can i find out the reason why a BuiltIn function in c# is returning false.

For example.

I have implemented Execute method in Microsoft.Build.Framework.ITask in one of my child class.This Execute function will return "True" if task i gave to execute success otherwise it returns False.My question is if it returns false how can i find out the reason behind the failure.

1

There are 1 best solutions below

2
On BEST ANSWER

Follow the example given in this example from MSDN, where you collect a Log of messages that you can later request and analyze to determine what happened.

When the return value is false, you retrieve the Log, and examine it for failure conditions. This could be a class constructed any way you like.