如何禁用 nuget 机器范围的缓存? [英] Howto disable nuget machine-wide cache?

查看:47
本文介绍了如何禁用 nuget 机器范围的缓存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如您所知,NuGet 使用 %LOCALAPPDATA%\NuGet\Cache 位置进行缓存.它首先检查请求的包是否在这里,然后在需要时下载.

As you know NuGet uses %LOCALAPPDATA%\NuGet\Cache location for caching. It first checks if requested packages is here then download if needed.

如何从 Nuget 和Visual Studio 2013"​​正确禁用此缓存机制,并确保它们始终从源下载?

我可以从源代码构建 Nuget 包管理器扩展,然后将其安装到 Visual Studio 吗?或者是否有禁用它的注册表配置?

Can I build Nuget Package Manager Extension from source, then install it to Visual Studio? Or Are there any registry configuration that disable it?

谢谢

推荐答案

您不能禁用 NuGet 使用缓存.在不更改源代码的情况下,您唯一可以做的就是使用 NuGetCachePath 环境变量更改缓存目录的位置.

You cannot disable NuGet from using a cache. The only thing you can do without changing the source code is to change the location of the cache directory using a NuGetCachePath environment variable.

因此,在安装 NuGet 包或修改 NuGet 的 Visual Studio 扩展的源代码之前,您只能手动或自动清除本地缓存.

So you are left with clearing the local cache manually or automatically before installing a NuGet package or modifying the source code for NuGet's Visual Studio extension.

NuGet 2.8.5 及更早版本的源代码可在 CodePlex 上找到.

The source code for NuGet 2.8.5 and older is available on CodePlex.

NuGet 3.0 的源代码可在 GitHub 上获得

The source code for NuGet 3.0 is available on GitHub

有一些说明关于如何设置 NuGet 开发环境,以便能够在 Visual Studio 中构建和运行 NuGet.

There are some instructions available on how to setup the NuGet development environment to be able to build and run NuGet within Visual Studio.

这篇关于如何禁用 nuget 机器范围的缓存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆