Bug 19974 - NuGet Cache stored in wrong location
Summary: NuGet Cache stored in wrong location
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: NuGet ()
Version: Trunk
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: master
Assignee: Matt Ward
Depends on:
Reported: 2014-05-21 16:03 UTC by Jon Dick
Modified: 2017-02-08 09:27 UTC (History)
3 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Jon Dick 2014-05-21 16:03:52 UTC
According to Alan, this is not the right location to store NuGet Cache .nupkg files.

It's storing them here:
Comment 1 Nischal 2014-05-22 01:24:06 UTC
Checked, NuGet Cache is storing at ~/.local/Share/NuGet/Cache/
Screencast for this: http://www.screencast.com/t/FjBDSqa5

Environment Info:
Xamarin Studio Version 5.0 (build 876)
Git revision: 892675cba83be2d00954bfdf22dd8a29e6a47502
Xamarin addins: c62ebd0f0c296c5773c7b92ad06d5b5b487f40e8
Comment 2 Matt Ward 2014-05-22 03:30:13 UTC
Where should NuGet be storing the cache on the Mac?

Currently the default location is taken from Environment.SpecialFolder.LocalApplicationData which maps to:

Mac: ~/.local/share/NuGet/Cache
Windows: %LocalAppData%/NuGet/Cache
Linux: ~/.local/share/NuGet/Cache
Comment 3 Jon Dick 2014-05-22 07:17:27 UTC
Well, currently it looks like a lot of things cached on mac get stored here:

~/Library/Caches/Xamarin/  (eg: Components are cached in ~/Library/Caches/Xamarin/Components/)
Comment 4 Matt Ward 2014-05-22 07:33:31 UTC
So NuGet should be using something like:


Whilst I can change NuGet that ships with Xamarin Studio the official NuGet.exe is another problem. If anyone uses that version it will still be using the old location (~/.local/share/NuGet/Cache). So we would have two NuGet caches.

NuGet does support an NuGetCache environment variable which can be used to override the default location of the cache which would affect all versions of NuGet. The change itself seems to have been there since 2011 so it should be in most versions of NuGet. Not sure if that helps us though.

Comment 5 Alan McGovern 2014-05-22 15:16:27 UTC
If this is just a default location that nuget uses, either we keep using it or we get nuget upstream to do the right thing.

~/Library/Caches is the right place to put caches, so it's up to them to fix their stuff. Should this just be marked as Resolved/upstream? Does anyone want to raise the topic with them?
Comment 6 Matt Ward 2014-05-22 15:38:26 UTC
Yes, Xamarin Studio is just using the default location that NuGet uses.

I think the best way to move this forward is to create a patch and see if we can get the NuGet team to accept it. I nominate myself to do this :)
Comment 7 Jeffrey Stedfast 2017-01-27 18:55:52 UTC
What is this marked NEEDINFO for?
Comment 8 Andres G. Aragoneses 2017-02-08 05:45:50 UTC
> I nominate myself to do this :)

Matt, did you get around to this?
Comment 9 Matt Ward 2017-02-08 09:20:29 UTC
No. The location can be configured. I think it is too late for this change now.

NuGet v2 uses ~/.local/share/cache/packages
NuGet v3, NuGet v4 and .NET Core use ~/.nuget/NuGet/packages

The default location can be overridden by setting the NUGET_PACKAGES environment variable for NuGet v3 and v4. With NuGet v2 the NuGetCachePath environment variable can be used.
Comment 10 Andres G. Aragoneses 2017-02-08 09:27:27 UTC
Thanks for the info.