Friday, July 1, 2011

TFS/MSBuild error with null character in compiler output

I ran into the following error on the TFS build server, which is building a MicroFocus Cobol.NET program:

MSBUILD : error MSB4015: The build stopped unexpectedly because the "WorkflowCentralLogger" logger failed unexpectedly during shutdown. System.ArgumentException: '.', hexadecimal value 0x00, is an invalid character. at System.Xml.XmlConvert.VerifyCharData(String data, ExceptionType invCharExceptionType, ExceptionType invSurrogateExceptionType) at System.Xml.XmlCharCheckingWriter.WriteString(String text) at System.Xml.XmlWriter.WriteAttributeString(String localName, String value) at Microsoft.TeamFoundation.Build.Client.InformationField.ToXml(XmlWriter writer, String element) at Microsoft.TeamFoundation.Build.Client.Helper.ToXml(XmlWriter writer, String element, InformationField[] array) at Microsoft.TeamFoundation.Build.Client.InformationAddRequest.ToXml(XmlWriter writer, String element) at Microsoft.TeamFoundation.Build.Client.Helper.ToXml(XmlWriter writer, String element, InformationChangeRequest[] array) at Microsoft.TeamFoundation.Build.Client.BuildWebService.UpdateBuildInformation(InformationChangeRequest[] changes)

Based on the stack trace, it looks like there was a problem converting the build output to XML, so it was just a matter of finding the culprit. A quick search through the build output using PowerShell located the offending \0 character (which it is not possible to represent in XML), so I loaded the build log into NotePad++ to confirm:

NUL char in NotePad++

Hopefully this will help anyone else who may run into this issue in TFS.

0 comments:

Post a Comment