Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Add missing ArtifactsPath property to dotnet restore #1518

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

SigtryggurO
Copy link
Contributor

Add missing ArtifactsPath property to dotnet restore

I confirm that the pull-request:

  • Follows the contribution guidelines
  • Is based on my own work
  • Is in compliance with my employer

@ITaluone
Copy link
Contributor

Is this an undocumented argument? I cannot see this on the restore command...

image

@MikeFarrington
Copy link

MikeFarrington commented Feb 14, 2025

Is this an undocumented argument? I cannot see this on the restore command...

It's not undocumented, but it looks like that page by Microsoft is not version-specific and caters to a least-common denominator of .NET Core 3.

image

This shell command

dotnet restore /?

Yields a more up to date result (I have the latest SDKs installed):

Description:
  .NET dependency restorer

Usage:
  dotnet restore [<PROJECT | SOLUTION>...] [options]

Arguments:
  <PROJECT | SOLUTION>  The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.

Options:
  --disable-build-servers             Force the command to ignore any persistent build servers.
  -s, --source <SOURCE>               The NuGet package source to use for the restore.
  --packages <PACKAGES_DIR>           The directory to restore packages to.
  --ucr, --use-current-runtime        Use current runtime as the target runtime.
  --disable-parallel                  Prevent restoring multiple projects in parallel.
  --configfile <FILE>                 The NuGet configuration file to use.
  --no-http-cache                     Disable Http Caching for packages.
  --ignore-failed-sources             Treat package source failures as warnings.
  -f, --force                         Force all dependencies to be resolved even if the last restore was successful.
                                      This is equivalent to deleting project.assets.json.
  -r, --runtime <RUNTIME_IDENTIFIER>  The target runtime to restore packages for.
  --no-dependencies                   Do not restore project-to-project references and only restore the specified project.
  -v, --verbosity <LEVEL>             Set the MSBuild verbosity level. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic].
  --interactive                       Allows the command to stop and wait for user input or action (for example to complete authentication).
  --artifacts-path <ARTIFACTS_DIR>    The artifacts path. All output from the project, including build, publish, and pack output, will go in subfolders under the specified path.
  --use-lock-file                     Enables project lock file to be generated and used with restore.
  --locked-mode                       Don't allow updating project lock file.
  --lock-file-path <LOCK_FILE_PATH>   Output location where project lock file is written. By default, this is 'PROJECT_ROOT\packages.lock.json'.
  --force-evaluate                    Forces restore to reevaluate all dependencies even if a lock file already exists.
  -a, --arch <ARCH>                   The target architecture.
  -?, -h, --help                      Show command line help.

It's not just 'restore' that accepts --artifacts-path, other commands like 'build' accept it as well. DotNetBuildSettings already got the SetArtifactsPath treatment, but DotNetRestoreSettings hadn't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants