Skip to content

Commit 454ccdd

Browse files
Merge pull request #10756 from ghogen/issue-8733
MSBuild: Add coverage of certain properties
2 parents ad19530 + 1fb0a9a commit 454ccdd

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

docs/msbuild/common-msbuild-project-properties.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ The following table lists frequently used properties that are defined in the Vis
5858
| DefineTrace | All | A boolean value that indicates whether you want the TRACE constant defined. |
5959
| DelaySign | .NET | A boolean value that indicates whether you want to delay-sign the assembly rather than full-sign it. |
6060
| Deterministic | .NET | A boolean value that indicates whether the compiler should produce identical assemblies for identical inputs. This parameter corresponds to the `/deterministic` switch of the compilers. |
61+
| DirectoryBuildPropsPath | All | Specifies the path to the *Directory.Build.props* file; if defined, this property overrides the default search algorithm. See [Customize your build](customize-your-build.md#directorybuildprops-and-directorybuildtargets). |
62+
| DirectoryBuildTargetsPath| All | Specifies the path to the *Directory.Build.targets* file; if defined, this property overrides the default search algorithm. See [Customize your build](customize-your-build.md#directorybuildprops-and-directorybuildtargets). |
6163
| DisableFastUpToDateCheck | All | A boolean value that applies to Visual Studio only. The Visual Studio build manager uses a process called FastUpToDateCheck to determine whether a project must be rebuilt to be up to date. This process is faster than using MSBuild to determine this. Setting the DisableFastUpToDateCheck property to `true` lets you bypass the Visual Studio build manager and force it to use MSBuild to determine whether the project is up to date. |
6264
| DocumentationFile | .NET | The name of the file that is generated as the XML documentation file. This name includes only the file name and has no path information. |
6365
| ErrorReport | .NET | Specifies how the compiler task should report internal compiler errors. Valid values are "prompt," "send," or "none." This property is equivalent to the `/errorreport` compiler switch. |
@@ -67,6 +69,8 @@ The following table lists frequently used properties that are defined in the Vis
6769
| GenerateDocumentation | .NET | A boolean parameter that indicates whether documentation is generated by the build. If `true`, the build generates documentation information and puts it in an *.xml* file together with the name of the executable file or library that the build task created. |
6870
| GenerateFullPaths | C# | Generate full paths for filenames in output by using the [-fullpaths](/dotnet/csharp/language-reference/compiler-options/fullpaths-compiler-option) compiler option. |
6971
| GenerateSerializationAssemblies | .NET | Indicates whether XML serialization assemblies should be generated by *SGen.exe*, which can be set to on, auto, or off. This property is used for assemblies that target .NET Framework only. To generate XML serialization assemblies for .NET Standard or .NET Core assemblies, reference the *Microsoft.XmlSerializer.Generator* NuGet package. |
72+
| ImportDirectoryBuildProps | All | A boolean value that indicates whether to import a *Directory.Build.props* file. See [Customize your build](customize-your-build.md#directorybuildprops-and-directorybuildtargets).|
73+
| ImportDirectoryBuildTargets | All | A boolean value that indicates whether to import a *Directory.Build.targets* file. See [Customize your build](customize-your-build.md#directorybuildprops-and-directorybuildtargets). |
7074
| IntermediateOutputPath | All | The full intermediate output path as derived from `BaseIntermediateOutputPath`, if no path is specified. For example, *obj\debug\\*. |
7175
| KeyContainerName | All | The name of the strong-name key container. |
7276
| KeyOriginatorFile | All | The name of the strong-name key file. |

docs/msbuild/customize-your-build.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,13 @@ A summary of MSBuild's general approach is as follows:
106106
- For any given project, MSBuild finds the first *Directory.Build.props* upward in the solution structure, merges it with defaults, and stops scanning for more.
107107
- If you want multiple levels to be found and merged, then [`<Import...>`](../msbuild/property-functions.md#msbuild-getpathoffileabove) (shown above) the "outer" file from the "inner" file.
108108
- If the "outer" file does not itself also import something above it, then scanning stops there.
109-
- To control the scanning/merging process, use `$(DirectoryBuildPropsPath)` and `$(ImportDirectoryBuildProps)`.
110109

111110
Or more simply: the first *Directory.Build.props* that doesn't import anything is where MSBuild stops.
112111

112+
To control the import process more explicitly, use the properties `$(DirectoryBuildPropsPath)`, `$(ImportDirectoryBuildProps)`, `$(DirectoryBuildTargetsPath)`, and `$(ImportDirectoryBuildTargets)`. The property `$(DirectoryBuildPropsPath)` specifies the path to the `Directory.Build.props` file to use; similarly, `$(DirectoryBuildTargetsPath)` specifies the path to the `Directory.Build.targets` file.
113+
114+
The Boolean properties `$(ImportDirectoryBuildProps)` and `$(ImportDirectoryBuildTargets)` are set to `true` by default, so MSBuild normally searches for these files, but you can set them to `false` to prevent MSBuild from importing them.
115+
113116
### Choose between adding properties to a .props or .targets file
114117

115118
MSBuild is import-order dependent, and the last definition of a property (or a `UsingTask` or target) is the definition used.

0 commit comments

Comments
 (0)