I get random NullReferenceExceptions which do show up on top of the Build Report before any other content and under the “Other Errors and Warnings”. My question is how can I find the root cause of this since setting the build to diagnostic level does not lead to any clues. Could it be a parallel activity that has thrown an exception in another thread or could it be an internal error inside the build agent?
Share
I have found the issue. After putting try/catch around the complete build workflow and another one around the build agent scope I did find that during the gated checkin activity outside the agent scope a NullReferenceException did occur.
The interesting thing was that it did happen inside an Assign activity originating from some VB lambda expression. It turned out the activity got some argument of the form
SomObject was null so the property evaluation inside the lambda did hickup with an NullReferenceException.