-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NoWarn the new .NET SDK netstandard1.x warning doesn't work #41787
Comments
Why does your log show "error NETSDK1215" rather than a warning? Microsoft.Common.CurrentVersion.targets sets MSBuildWarningsAsMessages to match $(NoWarn), which should downgrade the warning. But does your project or build environment set some options that interfere with this? |
Presumably because we upgrade warnings to errors via the |
The sdk/src/Tasks/Common/NETSdkWarning.cs Line 22 in ff97354
I think we would need to use https://apisof.net/catalog/e25be74c0e0f3ae3f0230429a6d2c04b to log a warning with a warning code in order for NoWarn / MSBuildWarningsAsMessages to work. |
not quite @ViktorHofer - that method is actually not using the MSBuild Logger, it's using the SDK version of Logger: sdk/src/Tasks/Common/Logger.cs Lines 66 to 67 in 5433bc4
|
Ah I see. So the SDK sends the warning level correctly to msbuild but for some reason |
Can I get a repro or a log? I wonder if there's a mix of NoWarn/MSBuildWarningsAsMessages involved, that's caused friction before. |
FWIW, I cannot reproduce this. I had tested NoWarn with the original PR and it was able to remove the warning. Here's the project file I have though note that if I remove NoWarn, I don't get NETSDK1215 as an error which is suspicious:
|
Interesting, this didn't work for SBRP. I'll take a look again tomorrow. |
There might be some other setting that's interacting strangely with nowarn. |
IIRC we've also seen some timing things, maybe it's setting NoWarn after it's already been read into MSBuildWarningsAsMessages? |
Damn. Not being able to suppress this warning makes the warning problematic. If we can't make |
We already have a property switch: https://github.com/dotnet/source-build-reference-packages/blob/0b53e839fa2f09a5994cc6006533dcc3d45a4226/Directory.Build.props#L20-L21 This issue is just about making sure that NoWarn also works. |
Awesome, glad we did that! |
I just tried this out in a sample app and NoWarn works. I noticed this in the source-build-reference-packages repo so I assume that somewhere there we are accidentally overriding other NoWarn entries. Sorry for the noise everyone. |
<NoWarn>$(NoWarn);NETSDK1215</NoWarn>
doesn't work. I see there's a separate msbuild property to disable the check but why can't I useNoWarn
?@marcpopMSFT @terrajobst
The text was updated successfully, but these errors were encountered: