fsprojects / Paket

A dependency manager for .NET with support for NuGet packages and Git repositories.
https://fsprojects.github.io/Paket/
MIT License
1.99k stars 520 forks source link

Paket does not use global nuget cache directory set in environment variable #4209

Open milbrandt opened 1 year ago

milbrandt commented 1 year ago

Description

Using nuget config it's possible to select an alternative nuget cache location with the environment variable NUGET_PACKAGES, see global packages at https://learn.microsoft.com/en-us/nuget/consume-packages/managing-the-global-packages-and-cache-folders.

Repro steps

Useing Paket version 7.2.0+bb14ab674b2748070a624f394cd6796e11aaffa8

Please provide the steps required to reproduce the problem

  1. Clear current NuGet caches dotnet nuget locals all --clear

  2. Move Nuget Cache to another drive, e.g. set NUGET_PACKAGESto E:\nuget in the Windows system environment variables.

  3. Restore a solution using Paket

  4. Build will fail, in the folder %USERPROFILE%\AppData\Local\NuGet\Cache\ projects are restored and not all files are in the corresponding subfolders, the environment variable is not respected

If possible then please create a git repository with a repro sample or attach a zip to the issue.

May be releated with https://github.com/fsprojects/Paket/issues/3853

Expected behavior

Please provide a description of the behavior you expect.

Actual behavior

Please provide a description of the actual behavior you observe.

Known workarounds

Don't use the environment variable :(, replace the directory %USERPROFILE%\AppData\Local\NuGet with a link to another drive.