|
2 | 2 | title: MSBuild Command-Line Reference | Microsoft Docs |
3 | 3 | description: Learn how to use MSBuild.exe command line to build a project or solution file, and several switches you can include. |
4 | 4 | ms.custom: SEO-VS-2020 |
5 | | -ms.date: 11/10/2022 |
| 5 | +ms.date: 2/9/2023 |
6 | 6 | ms.topic: reference |
7 | 7 | dev_langs: |
8 | 8 | - VB |
@@ -48,13 +48,13 @@ MSBuild.exe [Switches] [ProjectFile] |
48 | 48 | |-help|/? or -h|Display usage information. The following command is an example:<br /><br /> `msbuild.exe -?`| |
49 | 49 | |-ignoreProjectExtensions: `extensions`|-ignore: `extensions`|Ignore the specified extensions when determining which project file to build. Use a semicolon or a comma to separate multiple extensions, as the following example shows:<br /><br /> `-ignoreprojectextensions:.vcproj,.sln`| |
50 | 50 | |-interactive[:`True` or `False`]|-|Indicates that actions in the build are allowed to interact with the user. Do not use this argument in an automated scenario where interactivity is not expected. Specifying -interactive is the same as specifying -interactive:true. Use the parameter to override a value that comes from a response file. |
51 | | -|-isolateProjects[:`True` or `False`]|-isolate[:`True` or `False`]|Causes MSBuild to build each project in isolation. This is a more restrictive mode of MSBuild as it requires that the project graph be statically discoverable at evaluation time, but can improve scheduling and reduce memory overhead when building a large set of projects.| |
| 51 | +|-isolateProjects[:`True` or `MessageUponIsolationViolation` or `False`]|-isolate[:`True` or `MessageUponIsolationViolation` or `False`]|Causes MSBuild to build each project in isolation. When set to `MessageUponIsolationViolation` (or its short form `Message`), only the results from top-level targets are serialized if the `-outputResultsCache` switch is supplied. This is to mitigate the chances of an isolation-violating target on a dependency project using incorrect state due to its dependency on a cached target whose side effects would not be taken into account. (For example, the definition of a property.) This is a more restrictive mode of MSBuild as it requires that the project graph be statically discoverable at evaluation time, but can improve scheduling and reduce memory overhead when building a large set of projects.| |
52 | 52 | |-maxCpuCount[:`number`]|-m[:`number`]|Specifies the maximum number of concurrent processes to use when building. If you don't include this switch, the default value is 1. If you include this switch without specifying a value, MSBuild will use up to the number of processors in the computer. For more information, see [Building multiple projects in parallel](../msbuild/building-multiple-projects-in-parallel-with-msbuild.md).<br /><br /> The following example instructs MSBuild to build using three MSBuild processes, which allows three projects to build at the same time:<br /><br /> `msbuild myproject.proj -maxcpucount:3`| |
53 | 53 | |-noAutoResponse|-noautorsp|Don't include any *MSBuild.rsp* or *Directory.Build.rsp* files automatically.| |
54 | 54 | |-nodeReuse:`value`|-nr:`value`|Enable or disable the re-use of MSBuild nodes. You can specify the following values:<br /><br /> - **True**. Nodes remain after the build finishes so that subsequent builds can use them (default).<br />- **False**. Nodes don't remain after the build completes.<br /><br /> A node corresponds to a project that's executing. If you include the **-maxcpucount** switch, multiple nodes can execute concurrently.| |
55 | 55 | |-nologo||Don't display the startup banner or the copyright message.| |
56 | 56 | |<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).| |
57 | | -|-outputResultsCache[:cacheFile]|-orc[:cacheFile]|Output cache file where MSBuild will write the contents of its build result caches at the end of the build. Setting this also turns on isolated builds (-isolate).| |
| 57 | +|-outputResultsCache[:cacheFile]|-orc[:cacheFile]|Output cache file where MSBuild will write the contents of its build result caches at the end of the build. If `-isolateProjects` is set to `False`, this sets it to `True`.| |
58 | 58 | |-profileEvaluation:`<file>`|-|Profiles MSBuild evaluation and writes the result to the specified file. If the extension of the specified file is '.md', the result is generated in Markdown format. Otherwise, a tab-separated file is produced.| |
59 | 59 | |-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`| |
60 | 60 | |-restore|-r|Runs the `Restore` target prior to building the actual targets.| |
|
0 commit comments