From 22802824957c67115fbd59985c7752cac9b057a6 Mon Sep 17 00:00:00 2001 From: Maira Wenzel Date: Thu, 12 Oct 2017 17:17:11 -0700 Subject: [PATCH 1/6] added source option --- docs/core/tools/dotnet-build.md | 8 ++++++-- docs/core/tools/dotnet-publish.md | 12 ++++++++---- docs/core/tools/dotnet-restore.md | 2 +- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/docs/core/tools/dotnet-build.md b/docs/core/tools/dotnet-build.md index 6e666a78c3f90..19bbf09532011 100644 --- a/docs/core/tools/dotnet-build.md +++ b/docs/core/tools/dotnet-build.md @@ -3,7 +3,7 @@ title: dotnet build command - .NET Core CLI description: The dotnet build command builds a project and all of its dependencies. author: mairaw ms.author: mairaw -ms.date: 08/13/2017 +ms.date: 10/12/2017 ms.topic: article ms.prod: .net-core ms.technology: dotnet-cli @@ -20,7 +20,7 @@ ms.technology: dotnet-cli # [.NET Core 2.x](#tab/netcore2x) ``` -dotnet build [] [-c|--configuration] [-f|--framework] [--force] [--no-dependencies] [--no-incremental] [--no-restore] [-o|--output] [-r|--runtime] [-v|--verbosity] [--version-suffix] +dotnet build [] [-c|--configuration] [-f|--framework] [--force] [--no-dependencies] [--no-incremental] [--no-restore] [-o|--output] [-r|--runtime] [--source] [-v|--verbosity] [--version-suffix] dotnet build [-h|--help] ``` # [.NET Core 1.x](#tab/netcore1x) @@ -98,6 +98,10 @@ Directory in which to place the built binaries. You also need to define `--frame Specifies the target runtime. For a list of Runtime Identifiers (RIDs), see the [RID catalog](../rid-catalog.md). +`--source ` + +Specifies a NuGet package source to use during the restore operation. This overrides all of the sources specified in the *NuGet.config* files. Multiple sources can be provided by specifying this option multiple times. + `-v|--verbosity ` Sets the verbosity level of the command. Allowed values are `q[uiet]`, `m[inimal]`, `n[ormal]`, `d[etailed]`, and `diag[nostic]`. diff --git a/docs/core/tools/dotnet-publish.md b/docs/core/tools/dotnet-publish.md index e29132bff9c9e..5a2c381d28f2e 100644 --- a/docs/core/tools/dotnet-publish.md +++ b/docs/core/tools/dotnet-publish.md @@ -3,7 +3,7 @@ title: dotnet publish command - .NET Core CLI description: The dotnet publish command publishes your .NET Core project into a directory. author: mairaw ms.author: mairaw -ms.date: 09/01/2017 +ms.date: 10/12/2017 ms.topic: article ms.prod: .net-core ms.technology: dotnet-cli @@ -21,7 +21,7 @@ ms.technology: dotnet-cli # [.NET Core 2.x](#tab/netcore2x) ``` -dotnet publish [] [-c|--configuration] [-f|--framework] [--force] [--manifest] [no-dependencies] [--no-restore] [-o|--output] [-r|--runtime] [--self-contained] [-v|--verbosity] [--version-suffix] +dotnet publish [] [-c|--configuration] [-f|--framework] [--force] [--manifest] [no-dependencies] [--no-restore] [-o|--output] [-r|--runtime] [--self-contained] [--source] [-v|--verbosity] [--version-suffix] dotnet publish [-h|--help] ``` @@ -88,13 +88,17 @@ Doesn't perform an implicit restore when running the command. Specifies the path for the output directory. If not specified, it defaults to *./bin/[configuration]/[framework]/* for a framework-dependent deployment or *./bin/[configuration]/[framework]/[runtime]* for a self-contained deployment. If a relative path is provided, the output directory generated is relative to the project file location, not to the current working directory. +`-r|--runtime ` + +Publishes the application for a given runtime. This is used when creating a [self-contained deployment (SCD)](../deploying/index.md#self-contained-deployments-scd). For a list of Runtime Identifiers (RIDs), see the [RID catalog](../rid-catalog.md). Default is to publish a [framework-dependent deployment (FDD)](../deploying/index.md#framework-dependent-deployments-fdd). + `--self-contained` Publishes the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. If a runtime identifier is specified, its default value is `true`. For more infomation about the different deployment types, see [.NET Core application deployment](../deploying/index.md). -`-r|--runtime ` +`--source ` -Publishes the application for a given runtime. This is used when creating a [self-contained deployment (SCD)](../deploying/index.md#self-contained-deployments-scd). For a list of Runtime Identifiers (RIDs), see the [RID catalog](../rid-catalog.md). Default is to publish a [framework-dependent deployment (FDD)](../deploying/index.md#framework-dependent-deployments-fdd). +Specifies a NuGet package source to use during the restore operation. This overrides all of the sources specified in the *NuGet.config* files. Multiple sources can be provided by specifying this option multiple times. `-v|--verbosity ` diff --git a/docs/core/tools/dotnet-restore.md b/docs/core/tools/dotnet-restore.md index 15aaf7f962585..6b16163dca500 100644 --- a/docs/core/tools/dotnet-restore.md +++ b/docs/core/tools/dotnet-restore.md @@ -95,7 +95,7 @@ Specifies a runtime for the package restore. This is used to restore packages fo `-s|--source ` -Specifies a NuGet package source to use during the restore operation. This overrides all of the sources specified in the *NuGet.config* file(s). Multiple sources can be provided by specifying this option multiple times. +Specifies a NuGet package source to use during the restore operation. This overrides all of the sources specified in the *NuGet.config* files. Multiple sources can be provided by specifying this option multiple times. `--verbosity ` From 221a05db3c4da19bac824c9d755bf0667f4ed19f Mon Sep 17 00:00:00 2001 From: Maira Wenzel Date: Mon, 16 Oct 2017 19:25:08 -0700 Subject: [PATCH 2/6] feedback --- docs/core/tools/dotnet-publish.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/core/tools/dotnet-publish.md b/docs/core/tools/dotnet-publish.md index 5a2c381d28f2e..7657d4757872f 100644 --- a/docs/core/tools/dotnet-publish.md +++ b/docs/core/tools/dotnet-publish.md @@ -3,7 +3,7 @@ title: dotnet publish command - .NET Core CLI description: The dotnet publish command publishes your .NET Core project into a directory. author: mairaw ms.author: mairaw -ms.date: 10/12/2017 +ms.date: 10/16/2017 ms.topic: article ms.prod: .net-core ms.technology: dotnet-cli @@ -90,7 +90,7 @@ If a relative path is provided, the output directory generated is relative to th `-r|--runtime ` -Publishes the application for a given runtime. This is used when creating a [self-contained deployment (SCD)](../deploying/index.md#self-contained-deployments-scd). For a list of Runtime Identifiers (RIDs), see the [RID catalog](../rid-catalog.md). Default is to publish a [framework-dependent deployment (FDD)](../deploying/index.md#framework-dependent-deployments-fdd). +Publishes the application for a given runtime. This is used when creating a [self-contained deployment (SCD)](../deploying/index.md#self-contained-deployments-scd). For a list of Runtime Identifiers (RIDs), see the [RID catalog](../rid-catalog.md). The default behavior is to publish a [framework-dependent deployment (FDD)](../deploying/index.md#framework-dependent-deployments-fdd). `--self-contained` From c1a1935c531b896e00fb71cd086031f6f19a7de7 Mon Sep 17 00:00:00 2001 From: Maira Wenzel Date: Mon, 16 Oct 2017 21:41:32 -0700 Subject: [PATCH 3/6] feedback --- docs/core/tools/dotnet-build.md | 25 +++++++++++++++++++++++-- docs/core/tools/dotnet-publish.md | 23 ++++++++++++++++++++++- 2 files changed, 45 insertions(+), 3 deletions(-) diff --git a/docs/core/tools/dotnet-build.md b/docs/core/tools/dotnet-build.md index 19bbf09532011..779303e3f28f7 100644 --- a/docs/core/tools/dotnet-build.md +++ b/docs/core/tools/dotnet-build.md @@ -3,7 +3,7 @@ title: dotnet build command - .NET Core CLI description: The dotnet build command builds a project and all of its dependencies. author: mairaw ms.author: mairaw -ms.date: 10/12/2017 +ms.date: 10/16/2017 ms.topic: article ms.prod: .net-core ms.technology: dotnet-cli @@ -20,7 +20,8 @@ ms.technology: dotnet-cli # [.NET Core 2.x](#tab/netcore2x) ``` -dotnet build [] [-c|--configuration] [-f|--framework] [--force] [--no-dependencies] [--no-incremental] [--no-restore] [-o|--output] [-r|--runtime] [--source] [-v|--verbosity] [--version-suffix] +dotnet build [] [--configfile] [-c|--configuration] [--disable-parallel] [-f|--framework] [--force] [--ignore-failed-sources] [--no-cache] + [--no-dependencies] [--no-incremental] [--no-restore] [-o|--output] [--packages] [-r|--runtime] [--source] [-v|--verbosity] [--version-suffix] dotnet build [-h|--help] ``` # [.NET Core 1.x](#tab/netcore1x) @@ -62,10 +63,18 @@ The project file to build. If a project file is not specified, MSBuild searches # [.NET Core 2.x](#tab/netcore2x) +`--configfile ` + +The NuGet configuration file (*NuGet.config*) to use for the restore operation. + `-c|--configuration {Debug|Release}` Defines the build configuration. The default value is `Debug`. +`--disable-parallel` + +Disables restoring multiple projects in parallel. + `-f|--framework ` Compiles for a specific [framework](../../standard/frameworks.md). The framework must be defined in the [project file](csproj.md). @@ -78,6 +87,14 @@ Compiles for a specific [framework](../../standard/frameworks.md). The framework Prints out a short help for the command. +`--ignore-failed-sources` + +Only warn about failed sources if there are packages meeting the version requirement. + +`--no-cache` + +Specifies to not cache packages and HTTP requests. + `--no-dependencies` Ignores project-to-project (P2P) references and only builds the root project specified to build. @@ -94,6 +111,10 @@ Doesn't perform an implicit restore during build. Directory in which to place the built binaries. You also need to define `--framework` when you specify this option. +`--packages ` + +Specifies the directory for restored packages. + `-r|--runtime ` Specifies the target runtime. For a list of Runtime Identifiers (RIDs), see the [RID catalog](../rid-catalog.md). diff --git a/docs/core/tools/dotnet-publish.md b/docs/core/tools/dotnet-publish.md index 7657d4757872f..90406823bce1d 100644 --- a/docs/core/tools/dotnet-publish.md +++ b/docs/core/tools/dotnet-publish.md @@ -21,7 +21,8 @@ ms.technology: dotnet-cli # [.NET Core 2.x](#tab/netcore2x) ``` -dotnet publish [] [-c|--configuration] [-f|--framework] [--force] [--manifest] [no-dependencies] [--no-restore] [-o|--output] [-r|--runtime] [--self-contained] [--source] [-v|--verbosity] [--version-suffix] +dotnet publish [] [--configfile] [-c|--configuration] [--disable-parallel] [-f|--framework] [--force] [--ignore-failed-sources] [--manifest] [--no-cache] + [no-dependencies] [--no-restore] [-o|--output] [--packages] [-r|--runtime] [--self-contained] [--source] [-v|--verbosity] [--version-suffix] dotnet publish [-h|--help] ``` @@ -55,10 +56,18 @@ The project to publish, which defaults to the current directory if not specified # [.NET Core 2.x](#tab/netcore2x) +`--configfile ` + +The NuGet configuration file (*NuGet.config*) to use for the restore operation. + `-c|--configuration {Debug|Release}` Defines the build configuration. The default value is `Debug`. +`--disable-parallel` + +Disables restoring multiple projects in parallel. + `-f|--framework ` Publishes the application for the specified [target framework](../../standard/frameworks.md). You must specify the target framework in the project file. @@ -71,10 +80,18 @@ Forces all dependencies to be resolved even if the last restore was successful. Prints out a short help for the command. +`--ignore-failed-sources` + +Only warn about failed sources if there are packages meeting the version requirement. + `--manifest ` Specifies one or several [target manifests](../deploying/runtime-store.md) to use to trim the set of packages published with the app. The manifest file is part of the output of the [`dotnet store` command](dotnet-store.md). To specify multiple manifests, add a `--manifest` option for each manifest. This option is available starting with .NET Core 2.0 SDK. +`--no-cache` + +Specifies to not cache packages and HTTP requests. + `--no-dependencies` Ignores project-to-project references and only restores the root project. @@ -88,6 +105,10 @@ Doesn't perform an implicit restore when running the command. Specifies the path for the output directory. If not specified, it defaults to *./bin/[configuration]/[framework]/* for a framework-dependent deployment or *./bin/[configuration]/[framework]/[runtime]* for a self-contained deployment. If a relative path is provided, the output directory generated is relative to the project file location, not to the current working directory. +`--packages ` + +Specifies the directory for restored packages. + `-r|--runtime ` Publishes the application for a given runtime. This is used when creating a [self-contained deployment (SCD)](../deploying/index.md#self-contained-deployments-scd). For a list of Runtime Identifiers (RIDs), see the [RID catalog](../rid-catalog.md). The default behavior is to publish a [framework-dependent deployment (FDD)](../deploying/index.md#framework-dependent-deployments-fdd). From 198714734205eb0a8d590149e2fc48cac900cf42 Mon Sep 17 00:00:00 2001 From: Maira Wenzel Date: Tue, 6 Feb 2018 01:02:47 -0800 Subject: [PATCH 4/6] feedback --- docs/core/tools/dotnet-pack.md | 34 +++++++++++++++++++++++++++---- docs/core/tools/dotnet-publish.md | 16 +++++++-------- docs/core/tools/dotnet-run.md | 30 +++++++++++++++++++++++++-- 3 files changed, 66 insertions(+), 14 deletions(-) diff --git a/docs/core/tools/dotnet-pack.md b/docs/core/tools/dotnet-pack.md index 83c5f4b991dde..28fa6bc0c4baa 100644 --- a/docs/core/tools/dotnet-pack.md +++ b/docs/core/tools/dotnet-pack.md @@ -3,7 +3,7 @@ title: dotnet pack command - .NET Core CLI description: The dotnet pack command creates NuGet packages for your .NET Core project. author: mairaw ms.author: mairaw -ms.date: 12/13/2017 +ms.date: 02/06/2018 ms.topic: article ms.prod: .net-core ms.technology: dotnet-cli @@ -23,7 +23,9 @@ ms.workload: # [.NET Core 2.x](#tab/netcore2x) ``` -dotnet pack [] [-c|--configuration] [--force] [--include-source] [--include-symbols] [--no-build] [--no-dependencies] [--no-restore] [-o|--output] [--runtime] [-s|--serviceable] [-v|--verbosity] [--version-suffix] +dotnet pack [] [-c|--configuration] [--configfile] [--disable-parallel] [--force] [--ignore-failed-sources] + [--include-source] [--include-symbols] [--no-build] [--no-cache] [--no-dependencies] [--no-restore] [-o|--output] [--packages] + [--runtime] [-s|--serviceable] [--source] [-v|--verbosity] [--version-suffix] dotnet pack [-h|--help] ``` @@ -58,6 +60,14 @@ The project to pack. It's either a path to a [csproj file](csproj.md) or to a di Defines the build configuration. The default value is `Debug`. +`--configfile ` + +The NuGet configuration file (*NuGet.config*) to use for the restore operation. + +`--disable-parallel` + +Disables restoring multiple projects in parallel. + `--force` Forces all dependencies to be resolved even if the last restore was successful. This is equivalent to deleting the *project.assets.json* file. @@ -65,6 +75,10 @@ Forces all dependencies to be resolved even if the last restore was successful. Prints out a short help for the command. +`--ignore-failed-sources` + +Only warn about failed sources if there are packages meeting the version requirement. + `--include-source` Includes the source files in the NuGet package. The sources files are included in the `src` folder within the `nupkg`. @@ -77,6 +91,10 @@ Generates the symbols `nupkg`. Doesn't build the project before packing. +`--no-cache` + +Specifies to not cache packages and HTTP requests. + `--no-dependencies` Ignores project-to-project references and only restores the root project. @@ -89,6 +107,10 @@ Doesn't perform an implicit restore when running the command. Places the built packages in the directory specified. +`--packages ` + +Specifies the directory for restored packages. + `-r|--runtime ` Specifies the target runtime to restore packages for. For a list of Runtime Identifiers (RIDs), see the [RID catalog](../rid-catalog.md). @@ -97,6 +119,10 @@ Specifies the target runtime to restore packages for. For a list of Runtime Iden Sets the serviceable flag in the package. For more information, see [.NET Blog: .NET 4.5.1 Supports Microsoft Security Updates for .NET NuGet Libraries](https://aka.ms/nupkgservicing). +`--source ` + +Specifies a NuGet package source to use during the restore operation. This overrides all of the sources specified in the *NuGet.config* files. Multiple sources can be provided by specifying this option multiple times. + `--version-suffix ` Defines the value for the `$(VersionSuffix)` MSBuild property in the project. @@ -154,7 +180,7 @@ Pack the project in the current directory: Pack the `app1` project: `dotnet pack ~/projects/app1/project.csproj` - + Pack the project in the current directory and place the resulting packages into the `nupkgs` folder: `dotnet pack --output nupkgs` @@ -173,4 +199,4 @@ Set the package version to `2.1.0` with the `PackageVersion` MSBuild property: Pack the project for a specific [target framework](../../standard/frameworks.md): -`dotnet pack /p:TargetFrameworks=net45` +`dotnet pack /p:TargetFrameworks=net45` \ No newline at end of file diff --git a/docs/core/tools/dotnet-publish.md b/docs/core/tools/dotnet-publish.md index 8a93c6fb473bd..c878d948b678d 100644 --- a/docs/core/tools/dotnet-publish.md +++ b/docs/core/tools/dotnet-publish.md @@ -3,7 +3,7 @@ title: dotnet publish command - .NET Core CLI description: The dotnet publish command publishes your .NET Core project into a directory. author: mairaw ms.author: mairaw -ms.date: 10/16/2017 +ms.date: 02/06/2018 ms.topic: article ms.prod: .net-core ms.technology: dotnet-cli @@ -23,7 +23,7 @@ ms.workload: # [.NET Core 2.x](#tab/netcore2x) ``` -dotnet publish [] [--configfile] [-c|--configuration] [--disable-parallel] [-f|--framework] [--force] [--ignore-failed-sources] [--manifest] [--no-cache] +dotnet publish [] [-c|--configuration] [--configfile] [--disable-parallel] [-f|--framework] [--force] [--ignore-failed-sources] [--manifest] [--no-cache] [--no-dependencies] [--no-restore] [-o|--output] [--packages] [-r|--runtime] [--self-contained] [--source] [-v|--verbosity] [--version-suffix] dotnet publish [-h|--help] ``` @@ -58,14 +58,14 @@ The project to publish, which defaults to the current directory if not specified # [.NET Core 2.x](#tab/netcore2x) -`--configfile ` - -The NuGet configuration file (*NuGet.config*) to use for the restore operation. - `-c|--configuration {Debug|Release}` Defines the build configuration. The default value is `Debug`. +`--configfile ` + +The NuGet configuration file (*NuGet.config*) to use for the restore operation. + `--disable-parallel` Disables restoring multiple projects in parallel. @@ -177,11 +177,11 @@ Publish the project in the current directory: Publish the application using the specified project file: `dotnet publish ~/projects/app1/app1.csproj` - + Publish the project in the current directory using the `netcoreapp1.1` framework: `dotnet publish --framework netcoreapp1.1` - + Publish the current application using the `netcoreapp1.1` framework and the runtime for `OS X 10.10` (you must list this RID in the project file). `dotnet publish --framework netcoreapp1.1 --runtime osx.10.11-x64` diff --git a/docs/core/tools/dotnet-run.md b/docs/core/tools/dotnet-run.md index c6f5c0ac732d2..bb6efae0eacdc 100644 --- a/docs/core/tools/dotnet-run.md +++ b/docs/core/tools/dotnet-run.md @@ -3,7 +3,7 @@ title: dotnet run command - .NET Core CLI description: The dotnet run command provides a convenient option to run your application from the source code. author: mairaw ms.author: mairaw -ms.date: 09/24/2017 +ms.date: 02/06/2018 ms.topic: article ms.prod: .net-core ms.technology: dotnet-cli @@ -23,7 +23,9 @@ ms.workload: # [.NET Core 2.x](#tab/netcore2x) ``` -dotnet run [-c|--configuration] [-f|--framework] [--force] [--launch-profile] [--no-build] [--no-dependencies] [--no-launch-profile] [--no-restore] [-p|--project] [--runtime] [[--] [application arguments]] +dotnet run [-c|--configuration] [--configfile] [--disable-parallel] [-f|--framework] [--force] [--ignore-failed-sources] + [--launch-profile] [--no-build] [--no-cache] [--no-dependencies] [--no-launch-profile] [--no-restore] [-p|--project] + [--packages] [--runtime] [--source] [[--] [application arguments]] dotnet run [-h|--help] ``` @@ -66,6 +68,14 @@ Delimits arguments to `dotnet run` from arguments for the application being run. Defines the build configuration. The default value is `Debug`. +`--configfile ` + +The NuGet configuration file (*NuGet.config*) to use for the restore operation. + +`--disable-parallel` + +Disables restoring multiple projects in parallel. + `-f|--framework ` Builds and runs the app using the specified [framework](../../standard/frameworks.md). The framework must be specified in the project file. @@ -78,6 +88,10 @@ Forces all dependencies to be resolved even if the last restore was successful. Prints out a short help for the command. +`--ignore-failed-sources` + +Only warn about failed sources if there are packages meeting the version requirement. + `--launch-profile ` The name of the launch profile (if any) to use when launching the application. Launch profiles are defined in the *launchSettings.json* file and are typically called `Development`, @@ -87,6 +101,10 @@ The name of the launch profile (if any) to use when launching the application. L Doesn't build the project before running. +`--no-cache` + +Specifies to not cache packages and HTTP requests. + `--no-dependencies` When restoring a project with project-to-project (P2P) references, restores the root project and not the references. @@ -103,10 +121,18 @@ Doesn't perform an implicit restore when running the command. Specifies the path of the project file to run (folder name or full path). It defaults to the current directory if not specified. +`--packages ` + +Specifies the directory for restored packages. + `--runtime ` Specifies the target runtime to restore packages for. For a list of Runtime Identifiers (RIDs), see the [RID catalog](../rid-catalog.md). +`--source ` + +Specifies a NuGet package source to use during the restore operation. This overrides all of the sources specified in the *NuGet.config* files. Multiple sources can be provided by specifying this option multiple times. + # [.NET Core 1.x](#tab/netcore1x) `--` From 7747d67267a015d549532cbc5a9838a694531d28 Mon Sep 17 00:00:00 2001 From: Maira Wenzel Date: Tue, 6 Feb 2018 01:07:50 -0800 Subject: [PATCH 5/6] small fix --- docs/core/tools/dotnet-build.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/core/tools/dotnet-build.md b/docs/core/tools/dotnet-build.md index 31a1501f87c73..514ffdbd6fd54 100644 --- a/docs/core/tools/dotnet-build.md +++ b/docs/core/tools/dotnet-build.md @@ -3,7 +3,7 @@ title: dotnet build command - .NET Core CLI description: The dotnet build command builds a project and all of its dependencies. author: mairaw ms.author: mairaw -ms.date: 10/16/2017 +ms.date: 02/06/2018 ms.topic: article ms.prod: .net-core ms.technology: dotnet-cli @@ -22,7 +22,7 @@ ms.workload: # [.NET Core 2.x](#tab/netcore2x) ``` -dotnet build [] [--configfile] [-c|--configuration] [--disable-parallel] [-f|--framework] [--force] [--ignore-failed-sources] [--no-cache] +dotnet build [] [-c|--configuration] [--configfile] [--disable-parallel] [-f|--framework] [--force] [--ignore-failed-sources] [--no-cache] [--no-dependencies] [--no-incremental] [--no-restore] [-o|--output] [--packages] [-r|--runtime] [--source] [-v|--verbosity] [--version-suffix] dotnet build [-h|--help] ``` @@ -67,14 +67,14 @@ The project file to build. If a project file is not specified, MSBuild searches # [.NET Core 2.x](#tab/netcore2x) -`--configfile ` - -The NuGet configuration file (*NuGet.config*) to use for the restore operation. - `-c|--configuration {Debug|Release}` Defines the build configuration. The default value is `Debug`. +`--configfile ` + +The NuGet configuration file (*NuGet.config*) to use for the restore operation. + `--disable-parallel` Disables restoring multiple projects in parallel. From 219eb0ea4920cfb80d13bb5d5b0d8753da8c82e7 Mon Sep 17 00:00:00 2001 From: Maira Wenzel Date: Sat, 10 Mar 2018 01:01:57 -0800 Subject: [PATCH 6/6] switch to note + examples --- docs/core/tools/dotnet-build.md | 41 +++++++---------------- docs/core/tools/dotnet-pack.md | 39 ++++++---------------- docs/core/tools/dotnet-publish.md | 41 +++++++---------------- docs/core/tools/dotnet-restore.md | 2 +- docs/core/tools/dotnet-run.md | 43 +++++++------------------ includes/dotnet-restore-note-options.md | 4 +++ 6 files changed, 49 insertions(+), 121 deletions(-) create mode 100644 includes/dotnet-restore-note-options.md diff --git a/docs/core/tools/dotnet-build.md b/docs/core/tools/dotnet-build.md index 514ffdbd6fd54..b9d24be799e1d 100644 --- a/docs/core/tools/dotnet-build.md +++ b/docs/core/tools/dotnet-build.md @@ -3,7 +3,7 @@ title: dotnet build command - .NET Core CLI description: The dotnet build command builds a project and all of its dependencies. author: mairaw ms.author: mairaw -ms.date: 02/06/2018 +ms.date: 03/10/2018 ms.topic: article ms.prod: .net-core ms.technology: dotnet-cli @@ -22,13 +22,14 @@ ms.workload: # [.NET Core 2.x](#tab/netcore2x) ``` -dotnet build [] [-c|--configuration] [--configfile] [--disable-parallel] [-f|--framework] [--force] [--ignore-failed-sources] [--no-cache] - [--no-dependencies] [--no-incremental] [--no-restore] [-o|--output] [--packages] [-r|--runtime] [--source] [-v|--verbosity] [--version-suffix] +dotnet build [] [-c|--configuration] [-f|--framework] [--force] [--no-dependencies] [--no-incremental] + [--no-restore] [-o|--output] [-r|--runtime] [-v|--verbosity] [--version-suffix] dotnet build [-h|--help] ``` # [.NET Core 1.x](#tab/netcore1x) ``` -dotnet build [] [-c|--configuration] [-f|--framework] [--no-dependencies] [--no-incremental] [-o|--output] [-r|--runtime] [-v|--verbosity] [--version-suffix] +dotnet build [] [-c|--configuration] [-f|--framework] [--no-dependencies] [--no-incremental] [-o|--output] + [-r|--runtime] [-v|--verbosity] [--version-suffix] dotnet build [-h|--help] ``` --- @@ -41,7 +42,7 @@ If the project has third-party dependencies, such as libraries from NuGet, they' Building requires the *project.assets.json* file, which lists the dependencies of your application. The file is created when [`dotnet restore`](dotnet-restore.md) is executed. Without the assets file in place, the tooling cannot resolve reference assemblies, which results in errors. With .NET Core 1.x SDK, you needed to explicitily run the `dotnet restore` before running `dotnet build`. Starting with .NET Core 2.0 SDK, `dotnet restore` runs implicitily when you run `dotnet build`. If you want to disable implicit restore when running the build command, you can pass the `--no-restore` option. -[!INCLUDE[DotNet Restore Note](~/includes/dotnet-restore-note.md)] +[!INCLUDE[dotnet restore note + options](~/includes/dotnet-restore-note-options.md)] `dotnet build` uses MSBuild to build the project; thus, it supports both parallel and incremental builds. Refer to [Incremental Builds](/visualstudio/msbuild/incremental-builds) for more information. @@ -71,14 +72,6 @@ The project file to build. If a project file is not specified, MSBuild searches Defines the build configuration. The default value is `Debug`. -`--configfile ` - -The NuGet configuration file (*NuGet.config*) to use for the restore operation. - -`--disable-parallel` - -Disables restoring multiple projects in parallel. - `-f|--framework ` Compiles for a specific [framework](../../standard/frameworks.md). The framework must be defined in the [project file](csproj.md). @@ -91,14 +84,6 @@ Compiles for a specific [framework](../../standard/frameworks.md). The framework Prints out a short help for the command. -`--ignore-failed-sources` - -Only warn about failed sources if there are packages meeting the version requirement. - -`--no-cache` - -Specifies to not cache packages and HTTP requests. - `--no-dependencies` Ignores project-to-project (P2P) references and only builds the root project specified to build. @@ -115,18 +100,10 @@ Doesn't perform an implicit restore during build. Directory in which to place the built binaries. You also need to define `--framework` when you specify this option. -`--packages ` - -Specifies the directory for restored packages. - `-r|--runtime ` Specifies the target runtime. For a list of Runtime Identifiers (RIDs), see the [RID catalog](../rid-catalog.md). -`--source ` - -Specifies a NuGet package source to use during the restore operation. This overrides all of the sources specified in the *NuGet.config* files. Multiple sources can be provided by specifying this option multiple times. - `-v|--verbosity ` Sets the verbosity level of the command. Allowed values are `q[uiet]`, `m[inimal]`, `n[ormal]`, `d[etailed]`, and `diag[nostic]`. @@ -187,4 +164,8 @@ Build a project and its dependencies using Release configuration: Build a project and its dependencies for a specific runtime (in this example, Ubuntu 16.04): -`dotnet build --runtime ubuntu.16.04-x64` \ No newline at end of file +`dotnet build --runtime ubuntu.16.04-x64` + +Build the project and use the specified NuGet package source during the restore operation (.NET Core SDK 2.0 and later versions): + +`dotnet build --source c:\packages\mypackages` \ No newline at end of file diff --git a/docs/core/tools/dotnet-pack.md b/docs/core/tools/dotnet-pack.md index 28fa6bc0c4baa..a0e516cff34e6 100644 --- a/docs/core/tools/dotnet-pack.md +++ b/docs/core/tools/dotnet-pack.md @@ -3,7 +3,7 @@ title: dotnet pack command - .NET Core CLI description: The dotnet pack command creates NuGet packages for your .NET Core project. author: mairaw ms.author: mairaw -ms.date: 02/06/2018 +ms.date: 03/10/2018 ms.topic: article ms.prod: .net-core ms.technology: dotnet-cli @@ -23,9 +23,8 @@ ms.workload: # [.NET Core 2.x](#tab/netcore2x) ``` -dotnet pack [] [-c|--configuration] [--configfile] [--disable-parallel] [--force] [--ignore-failed-sources] - [--include-source] [--include-symbols] [--no-build] [--no-cache] [--no-dependencies] [--no-restore] [-o|--output] [--packages] - [--runtime] [-s|--serviceable] [--source] [-v|--verbosity] [--version-suffix] +dotnet pack [] [-c|--configuration] [--force] [--include-source] [--include-symbols] [--no-build] [--no-dependencies] + [--no-restore] [-o|--output] [--runtime] [-s|--serviceable] [-v|--verbosity] [--version-suffix] dotnet pack [-h|--help] ``` @@ -46,6 +45,8 @@ By default, `dotnet pack` builds the project first. If you wish to avoid this be You can provide MSBuild properties to the `dotnet pack` command for the packing process. For more information, see [NuGet metadata properties](csproj.md#nuget-metadata-properties) and the [MSBuild Command-Line Reference](/visualstudio/msbuild/msbuild-command-line-reference). The [Examples](#examples) section shows how to use the MSBuild /p switch for a couple of different scenarios. +[!INCLUDE[dotnet restore note + options](~/includes/dotnet-restore-note-options.md)] + ## Arguments `PROJECT` @@ -60,14 +61,6 @@ The project to pack. It's either a path to a [csproj file](csproj.md) or to a di Defines the build configuration. The default value is `Debug`. -`--configfile ` - -The NuGet configuration file (*NuGet.config*) to use for the restore operation. - -`--disable-parallel` - -Disables restoring multiple projects in parallel. - `--force` Forces all dependencies to be resolved even if the last restore was successful. This is equivalent to deleting the *project.assets.json* file. @@ -75,10 +68,6 @@ Forces all dependencies to be resolved even if the last restore was successful. Prints out a short help for the command. -`--ignore-failed-sources` - -Only warn about failed sources if there are packages meeting the version requirement. - `--include-source` Includes the source files in the NuGet package. The sources files are included in the `src` folder within the `nupkg`. @@ -91,10 +80,6 @@ Generates the symbols `nupkg`. Doesn't build the project before packing. -`--no-cache` - -Specifies to not cache packages and HTTP requests. - `--no-dependencies` Ignores project-to-project references and only restores the root project. @@ -107,10 +92,6 @@ Doesn't perform an implicit restore when running the command. Places the built packages in the directory specified. -`--packages ` - -Specifies the directory for restored packages. - `-r|--runtime ` Specifies the target runtime to restore packages for. For a list of Runtime Identifiers (RIDs), see the [RID catalog](../rid-catalog.md). @@ -119,10 +100,6 @@ Specifies the target runtime to restore packages for. For a list of Runtime Iden Sets the serviceable flag in the package. For more information, see [.NET Blog: .NET 4.5.1 Supports Microsoft Security Updates for .NET NuGet Libraries](https://aka.ms/nupkgservicing). -`--source ` - -Specifies a NuGet package source to use during the restore operation. This overrides all of the sources specified in the *NuGet.config* files. Multiple sources can be provided by specifying this option multiple times. - `--version-suffix ` Defines the value for the `$(VersionSuffix)` MSBuild property in the project. @@ -199,4 +176,8 @@ Set the package version to `2.1.0` with the `PackageVersion` MSBuild property: Pack the project for a specific [target framework](../../standard/frameworks.md): -`dotnet pack /p:TargetFrameworks=net45` \ No newline at end of file +`dotnet pack /p:TargetFrameworks=net45` + +Pack the project and use a specific runtime (Windows 10) for the restore operation (.NET Core SDK 2.0 and later versions): + +`dotnet pack --runtime win10-x64` \ No newline at end of file diff --git a/docs/core/tools/dotnet-publish.md b/docs/core/tools/dotnet-publish.md index c878d948b678d..f0d738b5cd213 100644 --- a/docs/core/tools/dotnet-publish.md +++ b/docs/core/tools/dotnet-publish.md @@ -3,7 +3,7 @@ title: dotnet publish command - .NET Core CLI description: The dotnet publish command publishes your .NET Core project into a directory. author: mairaw ms.author: mairaw -ms.date: 02/06/2018 +ms.date: 03/10/2018 ms.topic: article ms.prod: .net-core ms.technology: dotnet-cli @@ -23,8 +23,7 @@ ms.workload: # [.NET Core 2.x](#tab/netcore2x) ``` -dotnet publish [] [-c|--configuration] [--configfile] [--disable-parallel] [-f|--framework] [--force] [--ignore-failed-sources] [--manifest] [--no-cache] - [--no-dependencies] [--no-restore] [-o|--output] [--packages] [-r|--runtime] [--self-contained] [--source] [-v|--verbosity] [--version-suffix] +dotnet publish [] [-c|--configuration] [-f|--framework] [--force] [--manifest] [--no-dependencies] [--no-restore] [-o|--output] [-r|--runtime] [--self-contained] [-v|--verbosity] [--version-suffix] dotnet publish [-h|--help] ``` @@ -48,6 +47,8 @@ dotnet publish [-h|--help] The `dotnet publish` command's output is ready for deployment to a hosting system (for example, a server, PC, Mac, laptop) for execution and is the only officially supported way to prepare the application for deployment. Depending on the type of deployment that the project specifies, the hosting system may or may not have the .NET Core shared runtime installed on it. For more information, see [.NET Core Application Deployment](../deploying/index.md). For the directory structure of a published application, see [Directory structure](/aspnet/core/hosting/directory-structure). +[!INCLUDE[dotnet restore note + options](~/includes/dotnet-restore-note-options.md)] + ## Arguments `PROJECT` @@ -62,14 +63,6 @@ The project to publish, which defaults to the current directory if not specified Defines the build configuration. The default value is `Debug`. -`--configfile ` - -The NuGet configuration file (*NuGet.config*) to use for the restore operation. - -`--disable-parallel` - -Disables restoring multiple projects in parallel. - `-f|--framework ` Publishes the application for the specified [target framework](../../standard/frameworks.md). You must specify the target framework in the project file. @@ -82,18 +75,10 @@ Forces all dependencies to be resolved even if the last restore was successful. Prints out a short help for the command. -`--ignore-failed-sources` - -Only warn about failed sources if there are packages meeting the version requirement. - `--manifest ` Specifies one or several [target manifests](../deploying/runtime-store.md) to use to trim the set of packages published with the app. The manifest file is part of the output of the [`dotnet store` command](dotnet-store.md). To specify multiple manifests, add a `--manifest` option for each manifest. This option is available starting with .NET Core 2.0 SDK. -`--no-cache` - -Specifies to not cache packages and HTTP requests. - `--no-dependencies` Ignores project-to-project references and only restores the root project. @@ -107,21 +92,13 @@ Doesn't perform an implicit restore when running the command. Specifies the path for the output directory. If not specified, it defaults to *./bin/[configuration]/[framework]/* for a framework-dependent deployment or *./bin/[configuration]/[framework]/[runtime]* for a self-contained deployment. If a relative path is provided, the output directory generated is relative to the project file location, not to the current working directory. -`--packages ` - -Specifies the directory for restored packages. - -`-r|--runtime ` - -Publishes the application for a given runtime. This is used when creating a [self-contained deployment (SCD)](../deploying/index.md#self-contained-deployments-scd). For a list of Runtime Identifiers (RIDs), see the [RID catalog](../rid-catalog.md). The default behavior is to publish a [framework-dependent deployment (FDD)](../deploying/index.md#framework-dependent-deployments-fdd). - `--self-contained` Publishes the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. If a runtime identifier is specified, its default value is `true`. For more information about the different deployment types, see [.NET Core application deployment](../deploying/index.md). -`--source ` +`-r|--runtime ` -Specifies a NuGet package source to use during the restore operation. This overrides all of the sources specified in the *NuGet.config* files. Multiple sources can be provided by specifying this option multiple times. +Publishes the application for a given runtime. This is used when creating a [self-contained deployment (SCD)](../deploying/index.md#self-contained-deployments-scd). For a list of Runtime Identifiers (RIDs), see the [RID catalog](../rid-catalog.md). Default is to publish a [framework-dependent deployment (FDD)](../deploying/index.md#framework-dependent-deployments-fdd). `-v|--verbosity ` @@ -186,7 +163,11 @@ Publish the current application using the `netcoreapp1.1` framework and the runt `dotnet publish --framework netcoreapp1.1 --runtime osx.10.11-x64` +Publish the current application but don't restore project-to-project (P2P) references, just the root project during the restore operation (.NET Core SDK 2.0 and later versions): + +`dotnet publish --no-dependencies` + ## See also * [Target frameworks](../../standard/frameworks.md) -* [Runtime IDentifier (RID) catalog](../rid-catalog.md) +* [Runtime IDentifier (RID) catalog](../rid-catalog.md) \ No newline at end of file diff --git a/docs/core/tools/dotnet-restore.md b/docs/core/tools/dotnet-restore.md index d8bb42e797eb7..5d72e8edc8fc6 100644 --- a/docs/core/tools/dotnet-restore.md +++ b/docs/core/tools/dotnet-restore.md @@ -156,7 +156,7 @@ Specifies a runtime for the package restore. This is used to restore packages fo `-s|--source ` -Specifies a NuGet package source to use during the restore operation. This overrides all of the sources specified in the *NuGet.config* file(s). Multiple sources can be provided by specifying this option multiple times. +Specifies a NuGet package source to use during the restore operation. This overrides all of the sources specified in the *NuGet.config* files. Multiple sources can be provided by specifying this option multiple times. `--verbosity ` diff --git a/docs/core/tools/dotnet-run.md b/docs/core/tools/dotnet-run.md index bb6efae0eacdc..beb2351ed1c48 100644 --- a/docs/core/tools/dotnet-run.md +++ b/docs/core/tools/dotnet-run.md @@ -3,7 +3,7 @@ title: dotnet run command - .NET Core CLI description: The dotnet run command provides a convenient option to run your application from the source code. author: mairaw ms.author: mairaw -ms.date: 02/06/2018 +ms.date: 03/10/2018 ms.topic: article ms.prod: .net-core ms.technology: dotnet-cli @@ -23,9 +23,7 @@ ms.workload: # [.NET Core 2.x](#tab/netcore2x) ``` -dotnet run [-c|--configuration] [--configfile] [--disable-parallel] [-f|--framework] [--force] [--ignore-failed-sources] - [--launch-profile] [--no-build] [--no-cache] [--no-dependencies] [--no-launch-profile] [--no-restore] [-p|--project] - [--packages] [--runtime] [--source] [[--] [application arguments]] +dotnet run [-c|--configuration] [-f|--framework] [--force] [--launch-profile] [--no-build] [--no-dependencies] [--no-launch-profile] [--no-restore] [-p|--project] [--runtime] [[--] [application arguments]] dotnet run [-h|--help] ``` @@ -40,9 +38,9 @@ dotnet run [-h|--help] ## Description -The `dotnet run` command provides a convenient option to run your application from the source code with one command. It's useful for fast iterative development from the command line. The command depends on the [`dotnet build`](dotnet-build.md) command to build the code. Any requirements for the build, such as that the project must be restored first, apply to `dotnet run` as well. +The `dotnet run` command provides a convenient option to run your application from the source code with one command. It's useful for fast iterative development from the command line. The command depends on the [`dotnet build`](dotnet-build.md) command to build the code. Any requirements for the build, such as that the project must be restored first, apply to `dotnet run` as well. -Output files are written into the default location, which is `bin//`. For example if you have a `netcoreapp1.0` application and you run `dotnet run`, the output is placed in `bin/Debug/netcoreapp1.0`. Files are overwritten as needed. Temporary files are placed in the `obj` directory. +Output files are written into the default location, which is `bin//`. For example if you have a `netcoreapp1.0` application and you run `dotnet run`, the output is placed in `bin/Debug/netcoreapp1.0`. Files are overwritten as needed. Temporary files are placed in the `obj` directory. If the project specifies multiple frameworks, executing `dotnet run` results in an error unless the `-f|--framework ` option is used to specify the framework. @@ -56,6 +54,8 @@ For more information on the `dotnet` driver, see the [.NET Core Command Line Too In order to run the application, the `dotnet run` command resolves the dependencies of the application that are outside of the shared runtime from the NuGet cache. Because it uses cached dependencies, it's not recommended to use `dotnet run` to run applications in production. Instead, [create a deployment](../deploying/index.md) using the [`dotnet publish`](dotnet-publish.md) command and deploy the published output. +[!INCLUDE[dotnet restore note + options](~/includes/dotnet-restore-note-options.md)] + ## Options # [.NET Core 2.x](#tab/netcore2x) @@ -68,14 +68,6 @@ Delimits arguments to `dotnet run` from arguments for the application being run. Defines the build configuration. The default value is `Debug`. -`--configfile ` - -The NuGet configuration file (*NuGet.config*) to use for the restore operation. - -`--disable-parallel` - -Disables restoring multiple projects in parallel. - `-f|--framework ` Builds and runs the app using the specified [framework](../../standard/frameworks.md). The framework must be specified in the project file. @@ -88,10 +80,6 @@ Forces all dependencies to be resolved even if the last restore was successful. Prints out a short help for the command. -`--ignore-failed-sources` - -Only warn about failed sources if there are packages meeting the version requirement. - `--launch-profile ` The name of the launch profile (if any) to use when launching the application. Launch profiles are defined in the *launchSettings.json* file and are typically called `Development`, @@ -101,10 +89,6 @@ The name of the launch profile (if any) to use when launching the application. L Doesn't build the project before running. -`--no-cache` - -Specifies to not cache packages and HTTP requests. - `--no-dependencies` When restoring a project with project-to-project (P2P) references, restores the root project and not the references. @@ -121,18 +105,10 @@ Doesn't perform an implicit restore when running the command. Specifies the path of the project file to run (folder name or full path). It defaults to the current directory if not specified. -`--packages ` - -Specifies the directory for restored packages. - `--runtime ` Specifies the target runtime to restore packages for. For a list of Runtime Identifiers (RIDs), see the [RID catalog](../rid-catalog.md). -`--source ` - -Specifies a NuGet package source to use during the restore operation. This overrides all of the sources specified in the *NuGet.config* files. Multiple sources can be provided by specifying this option multiple times. - # [.NET Core 1.x](#tab/netcore1x) `--` @@ -156,7 +132,7 @@ Prints out a short help for the command. Specifies the path and name of the project file. (See the NOTE.) It defaults to the current directory if not specified. > [!NOTE] -> Use the path and name of the project file with the `-p|--project` option. A regression in the CLI prevents providing a folder path with .NET Core 1.x SDK. For more information about this issue, see [dotnet run -p, can not start a project (dotnet/cli #5992)](https://github.com/dotnet/cli/issues/5992). +> Use the path and name of the project file with the `-p|--project` option. A regression in the CLI prevents providing a folder path with .NET Core SDK 1.x. For more information about this issue, see [dotnet run -p, can not start a project (dotnet/cli #5992)](https://github.com/dotnet/cli/issues/5992). --- @@ -173,3 +149,8 @@ Run the specified project: Run the project in the current directory (the `--help` argument in this example is passed to the application, since the `--` argument is used): `dotnet run --configuration Release -- --help` + +Restore dependencies and tools for the project in the current directory only showing minimal output and then run the project: + (.NET Core SDK 2.0 and later versions): + +`dotnet run --verbosity m` \ No newline at end of file diff --git a/includes/dotnet-restore-note-options.md b/includes/dotnet-restore-note-options.md new file mode 100644 index 0000000000000..9419ce4c146c8 --- /dev/null +++ b/includes/dotnet-restore-note-options.md @@ -0,0 +1,4 @@ +> [!NOTE] +> Starting with .NET Core 2.0, you don't have to run [`dotnet restore`](~/docs/core/tools/dotnet-restore.md) because it's run implicitly by all commands, such as `dotnet build` and `dotnet run`, that require a restore to occur. It's still a valid command in certain scenarios where doing an explicit restore makes sense, such as [continuous integration builds in Visual Studio Team Services](/vsts/build-release/apps/aspnet/build-aspnet-core) or in build systems that need to explicitly control the time at which the restore occurs. +> +> This command also supports the `dotnet restore` options when passed in the long form (for example, `--source`). Short form options, such as `-s`, are not supported. \ No newline at end of file