Quantcast
Channel: WE MOVED to github.com/nuget. This site is not monitored!
Viewing all articles
Browse latest Browse all 7612

Closed Issue: Make MachineCache configurable [3177]

$
0
0
Please make it possible to customize the MachineCache (since you have hidden it inside several classes). It's the only way to customize the cache path.

Here is a suggestion:

```
public class MachineCache : LocalPackageRepository, IPackageCacheRepository
{
private const int MaxPackages = 100;
private const string NuGetCachePathEnvironmentVariable = "NuGetCachePath";
private static Lazy<MachineCache> _instance = new Lazy<MachineCache>(() => CreateDefault(GetCachePath));

public MachineCache(IFileSystem fileSystem)
: base(new DefaultPackagePathResolver(fileSystem), fileSystem, enableCaching: false)
{
}

public MachineCache(string cachePath)
: this(new PhysicalFileSystem(cachePath))
{
}

public static MachineCache Default
{
get { return _instance.Value; }
set { _instance = new Lazy<MachineCache>(() => value); }
}

// [....]
}
```



Viewing all articles
Browse latest Browse all 7612

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>