Kann ich den Standard-nuget-Paketordner unter Linux ändern? Ich benutze dotnet restore und finde den Cache in ~/.nuget/packages. Aber es ist nicht bequem für mich. DankeStandard-nuget-Cache-Ordner unter Linux ändern
0
A
Antwort
0
Sie können die NUGET_PACKAGES
env-Variable verwenden, um dies zu tun, oder Sie können --packages
zu der Zeit angeben, die Sie dotnet restore
ausführen. Die env-Variable ist undokumentiert, so dass es in der Zukunft Änderungen geben kann. Hier ist ein Link auf den entsprechenden Code für den Fall, was geschieht: https://github.com/dotnet/cli/blob/rel/1.0.0/build_projects/shared-build-targets-utils/Utils/Dirs.cs#L43
Die Ausgabe von dotnet restore --help
wird Ihnen mehr Details:
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
ich auch auf diese Frage lesen würde empfehlen, wenn Sie versuchen, gehen Offline-Entwicklung: How do you set up for offline development with .net Core