Skip to content

Commit 1e66419

Browse files
Merge pull request #13630 from MicrosoftDocs/ghogen-patch-98
Add information about macros / properties
2 parents ebb777a + e9d5231 commit 1e66419

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

docs/ide/how-to-specify-build-events-visual-basic.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: 'Specify build events (Visual Basic)'
33
description: Explore how to use build events in Visual Basic to run scripts, macros, or other actions as a part of the compilation process.
4-
ms.date: 12/13/2024
4+
ms.date: 2/20/2025
55
ms.subservice: compile-build
66
ms.topic: how-to
77
helpviewer_keywords:
@@ -54,14 +54,16 @@ Build events are specified in the **Build Events** dialog box, available from th
5454
:::moniker-end
5555

5656
> [!NOTE]
57-
> Add a `call` statement before all post-build commands that run *.bat* files. For example, `call C:\MyFile.bat` or `call C:\MyFile.bat call C:\MyFile2.bat`.
57+
> Add a `call` statement before all post-build commands that run `.bat` files. For example, `call C:\MyFile.bat` or `call C:\MyFile.bat call C:\MyFile2.bat`.
5858
5959
> [!NOTE]
6060
> If your pre-build or post-build event does not complete successfully, you can terminate the build by having your event action exit with a code other than zero (0), which indicates a successful action.
6161
62+
You can reference "macros" (actually MSBuild property names) in the scripts. To reference a property, use the syntax `$(PropertyName)`, which is substituted with the property value when the event script is executed. For a list of commonly used values, see [MSBuild common properties](../msbuild/common-msbuild-project-properties.md). There may be other properties as well as defined in the project file, in any imported files in the project file, in environment variables, or passed on the command line using the `-p` MSBuild switch during command-line builds.
63+
6264
## Example: How to change manifest information using a post-build event
6365

64-
The following procedure shows how to set the minimum operating system version in the application manifest using an *.exe* command called from a post-build event (the *.exe.manifest* file in the project directory). The minimum operating system version is a four-part number such as 4.10.0.0. To do this, the command will change the `<dependentOS>` section of the manifest:
66+
The following procedure shows how to set the minimum operating system version in the application manifest using an `.exe` command called from a post-build event (the `.exe.manifest` file in the project directory). The minimum operating system version is a four-part number such as 4.10.0.0. To do this, the command will change the `<dependentOS>` section of the manifest:
6567

6668
```xml
6769
<dependentOS>
@@ -159,9 +161,9 @@ The following procedure shows how to set the minimum operating system version in
159161

160162
`C:\TEMP\ChangeOSVersionVB.exe "$(TargetPath).manifest" 5.1.2600.0`
161163

162-
When you build the project, this command will change the minimum operating system version in the application manifest to 5.1.2600.0.
164+
When you build the project, this command changes the minimum operating system version in the application manifest to 5.1.2600.0.
163165

164-
The `$(TargetPath)` macro expresses the full path for the executable being created. Therefore, *$(TargetPath).manifest* will specify the application manifest created in the *bin* directory. Publishing will copy this manifest to the publishing location that you set earlier.
166+
The `$(TargetPath)` macro expresses the full path for the executable being created. Therefore, `$(TargetPath).manifest` specifes the application manifest created in the *bin* directory. Publishing copies this manifest to the publishing location that you set earlier.
165167

166168
8. Publish the project again. Go to the **Publish** page and click **Publish Now**.
167169

0 commit comments

Comments
 (0)