mikefourie-zz / MSBuildExtensionPack

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

XML logger produces invalid XML sometimes

alexeibs opened this issue · comments

Our VS project has a custom build step which is running Grunt to build some JS code. Grunt output includes some coloring escape sequences and these characters break XML generated by XML logger. For example, xsltproc from libxslt package fails wtih this error: "parser error : PCDATA invalid Char value 27".
As a workaround it is possible to pass --no-color argument to Grunt but I think XML logger should properly escape characters from MSBuild output.

can you attach a log / repo?

I've created a test repository https://github.com/alexeibs/xml_logger_test
It needs Node.js and npm in PATH. I build it using this command:

msbuild LoggerTest.sln /t:Build /p:Configuration=Debug;Platform=win32 /logger:XmlFileLogger,MSBuild.ExtensionPack.Loggers.dll;logfile=msbuild_log.xml;encoding=UTF-8

Generated msbuild_log.xml should contain some illegal characters.

Thanks for the details. will look into a fix.

Happy to take a PR for this.