fsprojects / fsprojects/Paket

Paket does not use global nuget cache directory set in configuration file

Open
#3,853 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
F#
Stars
2.1k
Forks
528
Avg merge
1d 12m
Merged PRs (30d)
54

Description

Description

Using nuget config it's possible to select an alternative nuget cache location: https://docs.microsoft.com/en-us/nuget/consume-packages/configuring-nuget-behavior

However, Paket does not properly use the configured value, causing some strange and confusing error messages, for example:

Package C:\src\project\packages\Microsoft.AspNet.Razor\microsoft.aspnet.razor.4.0.0-beta7.nupkg couldn't be extracted to "C:\src\project\packages\Microsoft.AspNet.Razor". System.IO.InvalidDataException: End of Central Directory record could not be found.. Trying to extract files individually.

Repro steps
  1. Set an alternate cache directory: nuget config -set globalPackagesFolder=e:\nuget\packages

  2. Verify the configuration: nuget config globalPackagesFolder, should return e:\nuget\packages

  3. Use paket restore

Expected behavior

Downloaded packages should be put in e:\nuget\packages

Actual behavior

Downloaded packages end up in C:\Users\user\.nuget\packages

Known workarounds

Setting the environment variable set NUGET_PACKAGES=e:\nuget\packages works.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the Paket restore entry point and trace how NuGet configuration is read, comparing globalPackagesFolder with the NUGET_PACKAGES workaround. Reproduce the issue with the provided nuget config and paket restore steps; done means packages are downloaded to the configured e:\nuget\packages path.

Written by the indexing model from the issue text.

Assessment

Tech stack
fsharp
Domain
build-system, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.