mikefourie-zz / MSBuildExtensionPack

MIT License
366 stars 104 forks source link

Avoid CDATA in CDATA #53

Closed bvamos closed 8 years ago

bvamos commented 8 years ago

If something writes out CDATA into the log, this logger crashes with the following error message:

MSBUILD : error MSB4017: The build stopped unexpectedly because of an unexpected logger failure. Microsoft.Build.Exceptions.InternalLoggerException: The build stopped unexpectedly because of an unexpected logger failure. ---> Microsoft.Build.Exceptions.InternalLoggerException: The build stopped u nexpectedly because of an unexpected logger failure. ---> System.ArgumentException: Cannot have ']]>' inside an XML CDATA block. at System.Xml.XmlTextWriter.WriteCData(String text) at MSBuild.ExtensionPack.Loggers.XmlFileLogger.WriteMessage(String message, Boolean escape)

To avoid this I have simply removed CDATA boundaries from the message.

You can test it by using this MSBuild task:

<Message Text="&lt;![CDATA[ something]]>" />

bvamos commented 8 years ago

Sorry for the tabs...