-
Notifications
You must be signed in to change notification settings - Fork 253
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 leads to extra packages being downloaded. #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. |
@nkolev92 As I mentioned above, |
I'm digging into your issue, and I was able to narrow it down. Per your repro, the following project was enough: <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net48</TargetFramework>
<RootNamespace>_13930</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="jQuery" Version="1.10.2" />
<PackageReference Include="jQuery.Validation" Version="1.11.1" />
</ItemGroup>
</Project>
The unusual part here is:
This seems to suggest that JQuery 1.4.4 is being listed in the content resource, but it's not downloadable. Here are some details: Can you tell me if you see 1.4.4 on your server there? |
@nkolev92 Hi, you summed it accurately. As far as I know our Nuget Proxy server lists all nuget versions from nuget.org as available, but if I try to download some old and/or vulnerable packages, then I'm not able to and get this error. |
Just a quick clarification. The new algorithm, tries to download that extra package, and it just so happens that it's not available. You said you're using a proxy correct? More explicitly clarifying what available means: NuGet/docs.microsoft.com-nuget#3360 |
@nkolev92 They closed the issue I filed on developercommunity as a duplicate of this issue lol, which I assume is not what we want. |
@nkolev92 We use Nexus Repository 2.15 if that helps. As I understand it right currently it returns as "available" all packages on nuget.org even though some of them are blocked and cannot be downloaded. The question is if this is the default behavior or it can be configured to not return these blocked/vulnerable packages? |
@mikernet Sorry about that. Reopened now. @martinsuchan I think that's something reaching out to the folks at Sonatype with some feedback. That being said, a quick summary for this issue. I'm sorry for all the issues you're running into. We focus on building features for the feature areas we get most feedback about and security and scaling for large repositories were things that we've been hearing a lot of feedback about. I can't tell you how much I appreciate all of your interactions, issue details, validations done etc. At this point, I'll close this issue as a duplicate of #13943. |
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: