mikefourie-zz / MSBuildExtensionPack

MIT License
366 stars 104 forks source link

XML logger produces invalid XML sometimes #43

Closed alexeibs closed 6 years ago

alexeibs commented 8 years ago

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.

mikefourie-zz commented 8 years ago

can you attach a log / repo?

alexeibs commented 8 years ago

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.

alexeibs commented 8 years ago

This is an example of generated XML https://github.com/alexeibs/xml_logger_test/blob/master/msbuild_log.xml

mikefourie-zz commented 8 years ago

Thanks for the details. will look into a fix.

mikefourie-zz commented 6 years ago

Happy to take a PR for this.