question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SDK 3.1.401 can no longer suppress NU5104 with NoWarn

See original GitHub issue

We 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:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
nkolev92commented, Aug 26, 2020

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.

0reactions
chipplymancommented, Feb 23, 2023

This is closed as complete, but I see no metadata or comments telling me which version has the fix.

Read more comments on GitHub >

github_iconTop Results From Across the Web

NuGet Warning NU5104
In this article ... A stable release of a package should not have a prerelease dependency. Either modify the version spec of dependency...
Read more >
Error NU1605 Detected package downgrade
Typically this is a package authoring error because the package depends on something that doesn't exist. You can also use <NoWarn>NU1603</NoWarn> ...
Read more >
NuGet Warning NU1605
A dependency package specified a version constraint on a higher version of a package than restore ultimately resolved.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found