You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/msbuild/how-to-extend-the-visual-studio-build-process.md
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -50,18 +50,18 @@ The following table shows all of the targets in *Microsoft.Common.targets* that
50
50
51
51
|Target name|Description|
52
52
|-----------------|-----------------|
53
-
|`BeforeCompile`, `AfterCompile`|Tasks inserted in one of these targets run before or after core compilation is done. Most customizations are done in one of these two targets.|
54
-
|`BeforeBuild`, `AfterBuild`|Tasks inserted in one of these targets will run before or after everything else in the build. **Note:** The `BeforeBuild` and `AfterBuild` targets are already defined in comments at the end of most project files, allowing you to easily add pre- and post-build events to your project file.|
55
-
|`BeforeRebuild`, `AfterRebuild`|Tasks inserted in one of these targets run before or after the core rebuild functionality is invoked. The order of target execution in *Microsoft.Common.targets* is: `BeforeRebuild`, `Clean`, `Build`, and then `AfterRebuild`.|
53
+
|`BeforeCompile`, `AfterCompile`|Tasks that are inserted in one of these targets run before or after core compilation is done. Most customizations are done in one of these two targets.|
54
+
|`BeforeBuild`, `AfterBuild`|Tasks that are inserted in one of these targets will run before or after everything else in the build. **Note:** The `BeforeBuild` and `AfterBuild` targets are already defined in comments at the end of most project files, allowing you to easily add pre- and post-build events to your project file.|
55
+
|`BeforeRebuild`, `AfterRebuild`|Tasks that are inserted in one of these targets run before or after the core rebuild functionality is invoked. The order of target execution in *Microsoft.Common.targets* is: `BeforeRebuild`, `Clean`, `Build`, and then `AfterRebuild`.|
56
56
|`BeforeClean`, `AfterClean`|Tasks that are inserted in one of these targets run before or after the core clean functionality is invoked.|
57
57
|`BeforePublish`, `AfterPublish`|Tasks that are inserted in one of these targets run before or after the core publish functionality is invoked.|
58
58
|`BeforeResolveReference`, `AfterResolveReferences`|Tasks that are inserted in one of these targets run before or after assembly references are resolved.|
59
59
|`BeforeResGen`, `AfterResGen`|Tasks that are inserted in one of these targets run before or after resources are generated.|
60
60
61
-
## Override "DependsOn" properties
61
+
## Override DependsOn properties
62
62
Overriding predefined targets is an easy way to extend the build process, but, because [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] evaluates the definition of targets sequentially, there is no way to prevent another project that imports your project from overriding the targets you already have overridden. So, for example, the last `AfterBuild` target defined in the project file, after all other projects have been imported, will be the one that is used during the build.
63
63
64
-
You can guard against unintended overrides of targets by overriding the "DependsOn" properties that are used in `DependsOnTargets` attributes throughout the *Microsoft.Common.targets* file. For example, the `Build` target contains a `DependsOnTargets` attribute value of `"$(BuildDependsOn)"`. Consider:
64
+
You can guard against unintended overrides of targets by overriding the DependsOn properties that are used in `DependsOnTargets` attributes throughout the *Microsoft.Common.targets* file. For example, the `Build` target contains a `DependsOnTargets` attribute value of `"$(BuildDependsOn)"`. Consider:
@@ -100,17 +100,17 @@ The following table shows all of the targets in *Microsoft.Common.targets* that
100
100
101
101
Projects that import your project files can override these properties without overwriting the customizations that you have made.
102
102
103
-
#### To override a "DependsOn" property
103
+
#### To override a DependsOn property
104
104
105
-
1. Identify a predefined "DependsOn" property in *Microsoft.Common.targets* that you want to override. See the table below for a list of the commonly overridden "DependsOn" properties.
105
+
1. Identify a predefined DependsOn property in *Microsoft.Common.targets* that you want to override. See the table below for a list of the commonly overridden DependsOn properties.
106
106
107
107
2. Define another instance of the property or properties at the end of your project file. Include the original property, for example `$(BuildDependsOn)`, in the new property.
108
108
109
109
3. Define your custom targets before or after the property definition.
0 commit comments