【问题标题】:Change default nuget cache folder on Linux更改 Linux 上的默认 nuget 缓存文件夹
【发布时间】:2016-08-04 13:33:44
【问题描述】:

我可以更改 Linux 上的默认 nuget 包文件夹吗?我使用 dotnet restore 发现缓存存储在 ~/.nuget/packages 中。但是对我来说不方便。谢谢

【问题讨论】:

    标签: nuget nuget-package nuget-package-restore nuget-server


    【解决方案1】:

    您可以使用NUGET_PACKAGES 环境变量来执行此操作,或者您可以在运行dotnet restore 时指定--packages。 env 变量没有记录,因此将来可能会发生变化。以下是相关代码的链接,以防万一:https://github.com/dotnet/cli/blob/rel/1.0.0/build_projects/shared-build-targets-utils/Utils/Dirs.cs#L43

    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
    

    如果您尝试进行离线开发,我还建议您阅读此问题: How do you set up for offline development with .net Core

    【讨论】:

      猜你喜欢
      • 2013-07-26
      • 1970-01-01
      • 2016-05-30
      • 1970-01-01
      • 2023-03-23
      • 2010-09-08
      • 1970-01-01
      • 1970-01-01
      • 2013-08-14
      相关资源
      最近更新 更多