-
Notifications
You must be signed in to change notification settings - Fork 252
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
New 6.12 Nuget algorithm results in very different packages being referenced. #13930
Comments
We're seeing issues with the new NuGet Dependency Resolver as well. Our repro:
Previous (expected) restore behavior with nuget 6.11:
Current broken behavior in nuget 6.12.1:
Note when I enabled CPM for this sample project, this error disappeared in nuget 6.12.1. |
Seeing something similar to this.. we're using lock files and on some projects we build out to specific RIDs, in our case linux-x64 and windows-x64.. This causes references to some packages like Tried the |
Does setting Similar question as Martin. |
The two |
No, there was no change in behaviour with that property. I tried in both our Directory.Build.props and in the affected csproj directly |
Also |
@andrew-from-toronto From what I can tell it doesn't work from csproj and .props, as I mentioned - try passing it to msbuild.exe as documented here: https://learn.microsoft.com/en-us/nuget/consume-packages/package-references-in-project-files#nuget-dependency-resolver |
I did see that, but realistically even if that works it's not an acceptable solution. I can't ask our dev team to restore packages like that. Just opening the projects in our IDEs throws the errors as it tries to restore packages. |
Yeah, obviously 😄 - I would love a solution that fixes it for now, if anyone has one. Can I overwrite the new nuget with 6.11 or something? I just need this stuff to work at the moment but I need VS 17.12. |
I think the request was to try it for purposes of determining whether that is indeed the root cause, not as an acceptable solution, but I don't want to speak for Nik so maybe he can clarify. |
Yes, we're just triaging and making sure we know how many separate issues we're tracking. After all, we want to be able to fix them all. |
I did some more testing with msbuild (including the |
Tracking issue: #13718 |
Update to my findings:
|
6.12.1 and 9.0.100 are running the same code, so it's a bit unusual that they're reporting different results. If you compare the We'll need to recreate the repro on our end to confirm that we have a fix. |
@martinsuchan Are you sure it isn't actually problematic for both, but you just tried |
9.0.100 has |
Sorry, both nuget 6.12.1 and dotnet 9.0.100 fails the restore. 🤦♂️ |
We can confirm whether it's related. Can you use the dotnet install scripts and install 9.0.200 preview? |
@nkolev92 Should I try that as well? Where are these preview install scripts? |
Note our proxy NuGet server works in a way that it "offers" all nugets available on nuget.org, but if you try to download some disabled packages, it fails. Maybe this has changed in dotnet 9.0.100 - it tries to download jQuery 1.44 and fails even though jQuery 1.10.,2 is defined at the top level? |
download from middle column https://github.com/dotnet/sdk/blob/main/documentation/package-table.md and unzip in somewhere like |
As far as I can tell, it doesn't look like it solves the issue. |
Ok, I tested dotnet restore with dotnet 9.0.200-0.24565.9 with the same error. |
Hey @mikernet, I'm narrowing down the root cause for your issue. I'll list out my findings, let me know if you're running into anything different.
Next steps:
It is possible that the only difference you're seeing between VS versions is audit defaulting to all (which includes transitives) vs previous reporting only direct. |
Interestingly, it looks like adding: <EnableMsixTooling>true</EnableMsixTooling> To the WinUI csproj files fixes this issue and it now works in VS 17.12. Maybe this is an issue for WinAppSdk instead? Or perhaps VS team? |
Back with more info. 17.8 and 17.11 behave the same, so for some reason, for WinUI projects, in VisualStudio, the RuntimeIdentifiers property are set, but not on the CLI. This leads to the different behavior for both. Summary: In @mikernet's case, the different is not due to the resolver, but rather due to 2 other factors.
Thank you for all the quick responses and clear repro steps @mikernet. It helped us get to the bottom of this quickly. @martinsuchan I want to try to understand the issues you're experiencing next. If you have any repro you can provide for me, that'd be ideal. |
NuGet Product Used
dotnet.exe, MSBuild.exe, Visual Studio Package Management UI
Product Version
6.12
Worked before?
Yes
Impact
I'm unable to use this version
Repro Steps & Context
New nuget algorithm references very different packages and versions, some of which have vulnerabilities, i.e.
System.Private.Uri
version4.3.0
.Steps to reproduce:
.sln
in VS.WinUI
projects, theproject.assets.json
files are wildly different, and you get errors that the projects reference packages with vulnerabilities.Note that putting this in
directory.build.props
or the project.csproj
files does not fix the issue when building from VS:It only "fixes" the issue when passed as a command-line argument into
msbuild.exe
, which means I don't know how to fix the VS development experience issues this now causes. The only way I can get the project to build again is to clear nuget cache, reopen the solution, and then I get one build until it breaks again.Verbose Logs
No response
The text was updated successfully, but these errors were encountered: