-
Notifications
You must be signed in to change notification settings - Fork 258
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 and transitive pinning does not play well together #12662
Comments
Seems like a duplicate of #5740. |
Is it? I apply the To me it seems like the transitive pinning "creates" package references that can't be changed with the Update gesture of the |
I might be missing something :) A few behavior that should work.
Something that doesn't work:
Now to your example: Pinning does effectively add a PackageReference when needed. I don't expect specifying I'd expect things to work if you specified NoWarn on the project level. Any chance you can upload a small repro here? You can always just provide the contents of the project files anonymized and provide a sample reference and let us know which warning the ref raises. |
I think that already explains why it does not work as I thought it would. I still did the small repro in this repository where changing the
By that, do you mean specifying the My question now is: Should we mark this as a duplicate of #5740? I think a solution for #5740 would somewhat solve my problem, but I also suspect that in the |
I think they are similar in that, you have a package whose reference is not explicitly added to the project and you want to control the assets, but different in that CPM has more of an intent since you might specify a version for a package that you never reference directly. I think the solution is likely similar as you mentioned though. |
Team Triage: Closing as dup of #5740 |
NuGet Product Used
dotnet.exe
Product Version
Version: 7.0.304
Worked before?
Don't think so
Impact
It bothers me. A fix would be nice
Repro Steps & Context
Hi,
Guidance for ignoring warnings with central package management enabled is to set the warnings to NoWarn in the Directory.Build.targets, as described in this comment #11952 (comment).
This works fine for me with
CentralPackageTransitivePinningEnabled=false
. If I turn transitive pinning on, I get problems though:I have a project reference to a project that imports a package that cause the warning NU1701. With transitive pinning enabled I can't suppress the warning in Project A with the update gesture (
PackageReference Update="Paket_that_causes_NU1701" NoWarn="%(NoWarn);NU1701"
).(In Project C itself the warning is suppressed just fine.)
Verbose Logs
No response
The text was updated successfully, but these errors were encountered: