-
-
Notifications
You must be signed in to change notification settings - Fork 221
Description
I'm writing a quick-and-dirty Linqpad script that uses BinLogReader to dump all C# and SSDT compiler messages from a .binlog to a CSV file such that the CSV file should contain exactly the same content as Visual Studio's Errors List (so Errors, Warnings, and Infos).
The problem is that "Info"-level warnings from csc are being treated by BinLogReader the exact same as any other stdout output from csc: they're not being parsed as BuildWarningEventArgs (i.e. with .Code and .File properties correctly set),, but kept as BuildMessageEventArgs with all empty properties, while their .Message property contains the raw packed string, which I really don't want to have to try to match/parse myself.
Currently I'm somewhat able to workaround this by relying on the .SenderName property being "Csc", but relying on that means I also get other csc stdout text like the "Microsoft (R) Visual C# Compiler version 4.12.0-3.25076.6 (449a6208)" messages, which I want to filter-out, but as far as BinLogReader is concerned they're all just plain ol' stdout text.
The other problem is that it's not just Csc in my MSBuild script: my SLN also includes SSDT projects (.sqlproj) which also generates warnings which also seem to be parsed inconsistently (...by both BinLogReader and Visual Studio itself: sometimes VS' Error List shows my SSDT warnings with everything in the Message column while all other columns (like Code, File, Project, etc) are all empty.
Here's a screenshot of what my CSV looks like in Excel (after converting it to a Table):
In the screenshot above, I've selected the bottom few rows (in the dark grey) to indicate which are the "Info CS9236" messages, in contrast to the rest of the messages which were correctly parsed as BuildWarningEventArgs with their .Code and .File properties set.
This means the behaviour is also seen in the MSBuild Binlog Viewer itself too:
(With my apologies for the atrocious MSPaint redaction job)
In the above screenshot, the csc.exe Warning messages are correctly identified with the yellow icons, but the Info-level messages are kept together with ordinary stdout text, just like in my CSV above.