更改Linux上的默认nuget缓存文件夹

更改Linux上的默认nuget缓存文件夹,nuget,nuget-package,nuget-package-restore,nuget-server,Nuget,Nuget Package,Nuget Package Restore,Nuget Server,我可以在Linux上更改默认的nuget packages文件夹吗。我使用dotnet还原并发现缓存存储在~/.nuget/packages中。但是这对我来说并不方便。谢谢您可以使用NUGET\u PACKAGESenv变量来执行此操作,或者您可以在运行dotnet restore时指定--PACKAGES。env变量未记录,因此将来可能会有更改。以下是发生这种情况时相关代码的链接: dotnet restore--help的输出将为您提供更多详细信息: Arguments: [root]

我可以在Linux上更改默认的nuget packages文件夹吗。我使用dotnet还原并发现缓存存储在~/.nuget/packages中。但是这对我来说并不方便。谢谢您可以使用
NUGET\u PACKAGES
env变量来执行此操作,或者您可以在运行
dotnet restore
时指定
--PACKAGES
。env变量未记录,因此将来可能会有更改。以下是发生这种情况时相关代码的链接:

dotnet restore--help的输出将为您提供更多详细信息:

Arguments:
  [root]  List of projects and project folders to restore. Each value can be: a path to a project.json or global.json file, or a folder to recursively search for project.json files.

Options:
  -h|--help                       Show help information
  --force-english-output          Forces the application to run using an invariant, English-based culture.
  -s|--source <source>            Specifies a NuGet package source to use during the restore.
  --packages <packagesDirectory>  Directory to install packages in.
  --disable-parallel              Disables restoring multiple projects in parallel.
  -f|--fallbacksource <FEED>      A list of packages sources to use as a fallback.
  --configfile <file>             The NuGet configuration file to use.
  --no-cache                      Do not cache packages and http requests.
  --infer-runtimes                Temporary option to allow NuGet to infer RIDs for legacy repositories
  -v|--verbosity <verbosity>      The verbosity of logging to use. Allowed values: Debug, Verbose, Information, Minimal, Warning, Error.
  --ignore-failed-sources         Only warning failed sources if there are packages meeting version requirement
参数:
[根目录]要还原的项目和项目文件夹的列表。每个值可以是:指向project.json或global.json文件的路径,或递归搜索project.json文件的文件夹。
选项:
-h |--帮助显示帮助信息
--强制英语输出强制应用程序使用不变的、基于英语的区域性运行。
-s |--source指定还原过程中要使用的NuGet包源。
--要在其中安装软件包的软件包目录。
--禁用并行禁用并行恢复多个项目。
-f |--fallbacksource要用作回退的包源的列表。
--configfile要使用的NuGet配置文件。
--无缓存不缓存包和http请求。
--推断运行时临时选项,允许NuGet推断遗留存储库的RID
-v |--verbosity要使用的日志记录的详细程度。允许的值:调试、详细、信息、最小值、警告、错误。
--忽略失败的源仅当存在满足版本要求的包时警告失败的源
如果您试图进行离线开发,我还建议您仔细阅读这个问题: