Skip to content
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

Nuget restore with --packages does not work as expected. The deprecated folder C:\Program Files\dotnet\sdk\NuGetFallBackFolder is still used silently. #13588

Closed
ghoebenreich opened this issue Jun 27, 2024 · 2 comments
Labels
Functionality:Restore Product:dotnet.exe Resolution:NeedMoreInfo This issue appears to not have enough info to take action Type:Bug WaitingForCustomer Applied when a NuGet triage person needs more info from the OP

Comments

@ghoebenreich
Copy link

NuGet Product Used

dotnet.exe

Product Version

6.0.420 [C:\Program Files\dotnet\sdk]

Worked before?

Never

Impact

It bothers me. A fix would be nice

Repro Steps & Context

I wanted to use the dotnet restore --package "packages" --force to restore all packages of my solution into the "packages" folder. No matter what I did I got different results on different computers.

Event after clearing the nuget cache with dotnet nuget locals all --clear i did not get the same number of restored packages.

I found out that the previous directory "C:\Program Files\dotnet\sdk\NuGetFallBackFolder" which was used prior to .NET 3.0 Core was still considered as cache. If the nuget package was already present in the C:\Program Files\dotnet\sdk\NuGetFallBackFolder the nuget package was not saved to the packages folder.

I would expect, using dotnet restore --force would take care of really considering all packages and store them, not only those which are in the official dotnet nuget cache lists.

I also would think that if something got removed and deprecated the C:\Program Files\dotnet\sdk\NuGetFallBackFolder is not of concern anyhow and should be ignored.

Verbose Logs

No response

@kartheekp-ms
Copy link
Contributor

Reading the spec for fallback packages folder, it looks like <clear/> tag is supported for that section of configuration. Can you please try adding the <clear /> tag as shown below and see if it works for your scenario?

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <fallbackPackageFolders>
     <clear />
  </fallbackPackageFolders>
</configuration>

@kartheekp-ms kartheekp-ms added WaitingForCustomer Applied when a NuGet triage person needs more info from the OP and removed Triage:Untriaged labels Jul 4, 2024
@dotnet-policy-service dotnet-policy-service bot added the Status:No recent activity No recent activity. label Jul 18, 2024
Copy link
Contributor

This issue has been automatically marked as stale because we have not received a response in 14 days. It will be closed if no further activity occurs within another 14 days of this comment.

@dotnet-policy-service dotnet-policy-service bot added Resolution:NeedMoreInfo This issue appears to not have enough info to take action and removed Status:No recent activity No recent activity. labels Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Functionality:Restore Product:dotnet.exe Resolution:NeedMoreInfo This issue appears to not have enough info to take action Type:Bug WaitingForCustomer Applied when a NuGet triage person needs more info from the OP
Projects
None yet
Development

No branches or pull requests

3 participants