roslyn: Incorrect error codes reported
Version Used:
I’m updating Windows Forms SDK/toolset from P6 to RC1, and our builds fail with errors which we have already suppressed. E.g.:
It appears instead of CS0618
we must now be suppressing SYSLIB0011
but I had to spend time to figure it out on my own.
Likewise we have other failures, e.g.
…and only VS is telling me that I now need to suppress a different one:
Few builds:
- https://dev.azure.com/dnceng/public/_build/results?buildId=817132&view=results
- https://dev.azure.com/dnceng/public/_build/results?buildId=817156&view=results
Steps to Reproduce:
- Clone this commit: https://github.com/dotnet/winforms/commit/2427ee0140db52050535e9459384e6527610720d
- Run
.\build.cmd
- Observe multiple failures
Expected Behavior:
Errors must either correctly report codes or use the existing suppression rules.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 25 (25 by maintainers)
/+warnaserror
seems to be the problem. The minimal repro project https://github.com/dotnet/roslyn/issues/47736#issuecomment-693708428 gives an unexpectederror CS0618
when either<WarningsAsErrors>SYSLIB0011</WarningsAsErrors>
is specified or<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
is specified.Thanks to @jmarolf for helping me track this down. I suppose this bug didn’t have the chance to negatively impact more people since corefx didn’t add custom diagnostic IDs until recently.
One thing I totally forgot to mention (sorry), to start Windows Forms solution in VS you need to run:
This will restore the necessary dependencies and set env vars for VS.