SDK 3.1.401 can no longer suppress NU5104 with NoWarn
See original GitHub issueWe have a dependency on a package with no release build available. Building release builds of our packages results in the NU5104 warning being issued.
Previously we were able to suppress this warning with NoWarn="NU5104"
on
the PackageReference
. With the 3.1.401
SDK this no longer works. The
exit status of dotnet pack
is now 1, causing our build pipeline to fail.
A minimal reproduction is in this Gist:
https://gist.github.com/iwillspeak/2d503703a579f5623fd5e5fb410a29f1
This can be worked around by installing an older SDK (e.g. 3.1.301) in our CI
pipeline, or by removing the <TreatWarningsAsErrors>
property.
I can’t find any reference to this being a deliberate change. Is this a regression?
How can we ignore the warning / error in this case? Ideally we would still be
able to use <TreatWarningsAsErrors>
for other warnings.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:7 (3 by maintainers)
I finally got some time to investigate this one.
I think the root cause is that pack doesn’t respect per PackageReference NoWarn.
Now that behavior is not a regression. It’s always been broken/not supported.
The reason why it appeared to work before was because pack always returned an exit code
0
and I fixed that in 3.1.400, https://github.com/NuGet/NuGet.Client/pull/3367.I will move this issue to NuGet/Home, but for now the recommendation is suppress it globally.
This is closed as complete, but I see no metadata or comments telling me which version has the fix.