Skip to content

Commit eb95411

Browse files
Merge pull request #10548 from MicrosoftDocs/main638702282540845863sync_temp
For protected branch, push strategy should use PR and merge to target branch method to work around git push error
2 parents 4a351bf + bb611e6 commit eb95411

File tree

618 files changed

+27300
-1576
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

618 files changed

+27300
-1576
lines changed

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

Lines changed: 26 additions & 8 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: 11/04/2016
4+
ms.date: 12/13/2024
55
ms.subservice: compile-build
66
ms.topic: how-to
77
helpviewer_keywords:
@@ -18,10 +18,26 @@ manager: mijacobs
1818

1919
Build events in Visual Basic can be used to run scripts, macros, or other actions as a part of the compilation process. Pre-build events occur before compilation; post-build events occur after compilation.
2020

21-
Build events are specified in the **Build Events** dialog box, available from the **Compile** page of the **Project Designer**.
21+
:::moniker range=">=vs-2022"
2222

23-
> [!NOTE]
24-
> Visual Basic Express does not support entry of build events. This is supported only in the full Visual Studio product.
23+
## How to specify pre-build and post-build events
24+
25+
To view or change build events for a Visual Basic .NET Core or .NET 5 and later project, right-click the project node, and choose **Properties** (or press **Alt**+**Enter**), then go to **Compile** > **Events**. Enter the desired command line. The working directory is the output directory.
26+
27+
For .NET Framework projects, follow these steps:
28+
29+
1. With a project selected in **Solution Explorer**, on the **Project** menu, click **Properties**.
30+
31+
2. Click the **Compile** tab.
32+
33+
3. Click the **Build Events** button to open the **Build Events** dialog box.
34+
35+
4. Enter the command-line arguments for your pre-build or post-build action, and then click **OK**.
36+
37+
:::moniker-end
38+
39+
:::moniker range="<=vs-2019"
40+
Build events are specified in the **Build Events** dialog box, available from the **Compile** page of the **Project Designer**.
2541

2642
## How to specify pre-build and post-build events
2743

@@ -35,11 +51,13 @@ Build events are specified in the **Build Events** dialog box, available from th
3551

3652
4. Enter the command-line arguments for your pre-build or post-build action, and then click **OK**.
3753

38-
> [!NOTE]
39-
> 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`.
54+
:::moniker-end
55+
56+
> [!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`.
4058
41-
> [!NOTE]
42-
> 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.
59+
> [!NOTE]
60+
> 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.
4361
4462
## Example: How to change manifest information using a post-build event
4563

14.3 KB
Loading

0 commit comments

Comments
 (0)