Skip to content

Commit bc50c01

Browse files
authored
Adds -restore switch to MSBuild CLI
dotnet/msbuild#2414 added a new `-restore` switch to MSBuild and this PR adds it to the command-line reference.
1 parent 34687c1 commit bc50c01

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

docs/msbuild/msbuild-command-line-reference.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ MSBuild.exe [Switches] [ProjectFile]
5050
|-nologo||Don't display the startup banner or the copyright message.|
5151
|<a name="preprocess"></a> -preprocess[:`filepath`]|-pp[:`filepath`]|Create a single, aggregated project file by inlining all the files that would be imported during a build, with their boundaries marked. You can use this switch to more easily determine which files are being imported, from where the files are being imported, and which files contribute to the build. When you use this switch, the project isn't built.<br /><br /> If you specify a `filepath`, the aggregated project file is output to the file. Otherwise, the output appears in the console window.<br /><br /> For information about how to use the `Import` element to insert a project file into another project file, see [Import element (MSBuild)](../msbuild/import-element-msbuild.md) and [How to: Use the same target in multiple project files](../msbuild/how-to-use-the-same-target-in-multiple-project-files.md).|
5252
|-property:`name`=`value`|/p:`name`=`value`|Set or override the specified project-level properties, where `name` is the property name and `value` is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:<br /><br /> `-property:WarningLevel=2;OutDir=bin\Debug`|
53+
|-restore|-r|Runs the `Restore` target prior to building the actual targets.|
5354
|-target:`targets`|-t:`targets`|Build the specified targets in the project. Specify each target separately, or use a semicolon or comma to separate multiple targets, as the following example shows:<br /><br /> `-target:Resources;Compile`<br /><br /> If you specify any targets by using this switch, they are run instead of any targets in the `DefaultTargets` attribute in the project file. For more information, see [Target build order](../msbuild/target-build-order.md) and [How to: Specify which target to build first](../msbuild/how-to-specify-which-target-to-build-first.md).<br /><br /> A target is a group of tasks. For more information, see [Targets](../msbuild/msbuild-targets.md).|
5455
|-toolsversion:`version`|-tv:`version`|Specifies the version of the Toolset to use to build the project, as the following example shows: `-toolsversion:3.5`<br /><br /> By using this switch, you can build a project and specify a version that differs from the version that's specified in the [Project element (MSBuild)](../msbuild/project-element-msbuild.md). For more information, see [Overriding ToolsVersion settings](../msbuild/overriding-toolsversion-settings.md).<br /><br /> For MSBuild 4.5, you can specify the following values for `version`: 2.0, 3.5, and 4.0. If you specify 4.0, the `VisualStudioVersion` build property specifies which sub-toolset to use. For more information, see the Sub-toolsets section of [Toolset (ToolsVersion)](../msbuild/msbuild-toolset-toolsversion.md).<br /><br /> A Toolset consists of tasks, targets, and tools that are used to build an application. The tools include compilers such as *csc.exe* and *vbc.exe*. For more information about Toolsets, see [Toolset (ToolsVersion)](../msbuild/msbuild-toolset-toolsversion.md), [Standard and custom toolset configurations](../msbuild/standard-and-custom-toolset-configurations.md), and [Multitargeting](../msbuild/msbuild-multitargeting-overview.md). **Note:** The toolset version isn't the same as the target framework, which is the version of the .NET Framework on which a project is built to run. For more information, see [Target framework and target platform](../msbuild/msbuild-target-framework-and-target-platform.md).|
5556
|-validate:[`schema`]|-val[`schema`]|Validate the project file and, if validation succeeds, build the project.<br /><br /> If you don't specify `schema`, the project is validated against the default schema.<br /><br /> If you specify `schema`, the project is validated against the schema that you specify.<br /><br /> The following setting is an example: `-validate:MyExtendedBuildSchema.xsd`|

0 commit comments

Comments
 (0)