-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Add documentation for Visual Basic -pathmap compiler option #48177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
5e70a90
Initial plan
Copilot 01759ca
Add -pathmap compiler option documentation for Visual Basic
Copilot 12b8116
Apply suggestions from code review
BillWagner 039cedd
Apply suggestions from code review
BillWagner ccbfd0a
Apply code review suggestions and add pathmap to Visual Basic TOC
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
docs/visual-basic/reference/command-line-compiler/pathmap.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| --- | ||
| description: "Learn more about: -pathmap" | ||
| title: "-pathmap" | ||
| ms.date: 09/04/2025 | ||
| f1_keywords: | ||
| - "pathmap" | ||
| - "-pathmap" | ||
| helpviewer_keywords: | ||
| - "-pathmap compiler option [Visual Basic]" | ||
| - "/pathmap compiler option [Visual Basic]" | ||
| - "pathmap compiler option [Visual Basic]" | ||
| ai-usage: ai-generated | ||
| --- | ||
| # -pathmap | ||
|
|
||
| Specifies how to map physical paths to source path names output by the compiler. | ||
|
|
||
| ## Syntax | ||
|
|
||
| ```console | ||
| -pathmap:path1=sourcePath1,path2=sourcePath2 | ||
| ``` | ||
|
|
||
| ## Arguments | ||
|
|
||
| | Term | Definition | | ||
BillWagner marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| |----------------|-----------------------------------------------------------------------------| | ||
| | `path1` | Required. The full path to the source files in the current environment. | | ||
| | `sourcePath1` | Required. The source path substituted for `path1` in any output files. | | ||
|
|
||
| ## Remarks | ||
|
|
||
| > [!NOTE] | ||
| > Specifying `-pathmap` prevents breakpoints from working in local debug builds. Only set `-pathmap` for production or continuous integration builds. | ||
|
|
||
| The `-pathmap` compiler option specifies how to map physical paths to source path names output by the compiler. This option maps each physical path on the machine where the compiler runs to a corresponding path that should be written in the output files. | ||
|
|
||
| To specify multiple mapped source paths, separate each with a comma. | ||
|
|
||
| The compiler writes the source path into its output for the following reasons: | ||
|
|
||
| - The source path is substituted for an argument when the <xref:System.Runtime.CompilerServices.CallerFilePathAttribute> is applied to an optional parameter. | ||
| - The source path is embedded in a PDB file. | ||
| - The path of the PDB file is embedded into a PE (portable executable) file. | ||
|
|
||
| The `-pathmap` option is not available from within the Visual Studio development environment; it's available only when compiling from the command line. | ||
|
|
||
| ## Example | ||
|
|
||
| The following example compiles `Test.vb` and maps the source paths: | ||
|
|
||
| ```console | ||
| vbc -pathmap:C:\MyProject\=\BuildServer\,C:\Temp\=\BuildTemp\ Test.vb | ||
| ``` | ||
|
|
||
| In this example, if a source file is located at `C:\MyProject\Program.vb`, it will appear in the output as `\BuildServer\Program.vb`. | ||
|
|
||
| ## See also | ||
|
|
||
| - [Visual Basic Command-Line Compiler](index.md) | ||
| - [Sample Compilation Command Lines](sample-compilation-command-lines.md) | ||
| - <xref:System.Runtime.CompilerServices.CallerFilePathAttribute> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.