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
Fix#49457 – Update VB build instructions to prefer dotnet build over vbc.exe (#49518)
* Add 'See also' link to dotnet build in VB compiler doc
* Fix#49457 - Update VB build instructions to prefer dotnet build over vbc.exe
* Fix link path typo in VB compiler doc
* Fix link path for dotnet build in VB compiler doc
* Fix relative link path for dotnet build reference
* Fix markdown code block formatting to resolve OPS warning
* Fix markdown code block formatting to resolve OPS warning
* Fix markdown code block formatting to resolve OPS warning
* Fix markdown code block formatting to resolve OPS warning
* Fixed markdown formatting and duplicate code block issue in VB command-line compiler doc
* Fixed markdown formatting and duplicate code block issue in VB command-line compiler doc
* Move tip to top and add styled link to dotnet build
* Move tip to top and add styled link to dotnet build
* Remove extra blank lines from VB compiler doc
Copy file name to clipboardExpand all lines: docs/visual-basic/reference/command-line-compiler/how-to-invoke-the-command-line-compiler.md
+23-8Lines changed: 23 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,11 @@ helpviewer_keywords:
9
9
- "command line [Visual Basic], arguments"
10
10
ms.assetid: 0fd9a8f6-f34e-4c35-a49d-9b9bbd8da4a9
11
11
---
12
-
# How to: Invoke the Command-Line Compiler (Visual Basic)
12
+
# How to Invoke the Command-Line Compiler
13
+
14
+
[!TIP]
15
+
For modern .NET projects, use the [`dotnet build`](../../../core/tools/dotnet-build.md) command to compile Visual Basic source files.
16
+
The `vbc.exe` command-line compiler is only used for older .NET Framework projects.
13
17
14
18
You can invoke the command-line compiler by typing the name of its executable file into the command line, also known as the MS-DOS prompt. If you compile from the default Windows Command Prompt, you must type the fully qualified path to the executable file. To override this default behavior, you can either use the Developer Command Prompt for Visual Studio, or modify the PATH environment variable. Both allow you to compile from any directory by simply typing the compiler name.
15
19
@@ -19,13 +23,18 @@ You can invoke the command-line compiler by typing the name of its executable fi
19
23
20
24
1. Open the Visual Studio Tools program folder within the Microsoft Visual Studio program group.
21
25
22
-
2. You can use the Developer Command Prompt for Visual Studio to access the compiler from any directory on your machine, if Visual Studio is installed.
26
+
2. You can use the **Developer Command Prompt for Visual Studio** to access the compiler from any directory on your machine, if Visual Studio is installed.
27
+
28
+
3. Open the **Developer Command Prompt for Visual Studio**.
23
29
24
-
3. Invoke the Developer Command Prompt for Visual Studio.
30
+
4. At the command line, type `vbc.exe <sourceFileName>` and then press **Enter**.
25
31
26
-
4. At the command line, type `vbc.exe`*sourceFileName* and then press ENTER.
32
+
For example, if you stored your source code in a directory called `SourceFiles`, you would open the Command Prompt and type:
27
33
28
-
For example, if you stored your source code in a directory called `SourceFiles`, you would open the Command Prompt and type `cd SourceFiles` to change to that directory. If the directory contained a source file named `Source.vb`, you could compile it by typing `vbc.exe Source.vb`.
34
+
```cmd
35
+
cd SourceFiles
36
+
vbc.exe Source.vb
37
+
```
29
38
30
39
## To set the PATH environment variable to the compiler for the Windows Command Prompt
31
40
@@ -43,17 +52,23 @@ You can invoke the command-line compiler by typing the name of its executable fi
43
52
44
53
6. Click **OK** to confirm your edits and close the dialog boxes.
45
54
46
-
After you change the PATH environment variable, you can run the Visual Basic compiler at the Windows Command Prompt from any directory on the computer.
55
+
After you change the PATH environment variable, you can run the Visual Basic compiler at the Windows Command Prompt from any directory on the computer.
47
56
48
57
## To invoke the compiler using the Windows Command Prompt
49
58
50
59
1. From the **Start** menu, click on the **Accessories** folder, and then open the **Windows Command Prompt**.
51
60
52
-
2. At the command line, type `vbc.exe`*sourceFileName* and then press ENTER.
61
+
2. At the command line, type `vbc.exe <sourceFileName>` and then press **Enter**.
62
+
63
+
For example, if you stored your source code in a directory called `SourceFiles`, you would open the Command Prompt and type:
53
64
54
-
For example, if you stored your source code in a directory called `SourceFiles`, you would open the Command Prompt and type `cd SourceFiles` to change to that directory. If the directory contained a source file named `Source.vb`, you could compile it by typing `vbc.exe Source.vb`.
0 commit comments