|
1 |
| -# Instructions for setting up the .NET Core debugger |
2 |
| -This page gives you detailed instructions on how to debug code running under .NET Core in VS Code. |
| 1 | +## .NET Debugging in Visual Studio Code |
3 | 2 |
|
4 |
| -#### Your Feedback |
5 |
| -File bugs and feature requests [here](https://github.com/dotnet/vscode-csharp/issues) to help us build great tooling for .NET Core. |
| 3 | +While it is possible to use the C# extension as a standalone extension, we highly recommend using [C# Dev Kit](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csharp). When using C# Dev Kit, the [official C# debugger documentation](https://code.visualstudio.com/docs/csharp/debugging) and the [official getting started guide](https://code.visualstudio.com/docs/csharp/getting-started) should be used instead of this page. |
| 4 | + |
| 5 | +## Getting started debugging without C# Dev Kit |
| 6 | + |
| 7 | +This guide provides information on getting started with .NET debugging when using the C# extension without C# Dev Kit. |
6 | 8 |
|
7 | 9 | ### First Time setup
|
8 | 10 | ##### 1: Get Visual Studio Code
|
9 | 11 | Install Visual Studio Code (VS Code). Pick the latest VS Code version from here: https://code.visualstudio.com
|
10 | 12 |
|
11 | 13 | ##### 2: Install .NET command line tools
|
12 |
| -Install the .NET Core command line tools (CLI) by following the installation part of the instructions here: https://dotnet.microsoft.com/download |
| 14 | +Install the .NET command line tools (CLI) by following the installation part of the instructions here: https://dotnet.microsoft.com/download |
13 | 15 |
|
14 | 16 | ##### 3: Install C# Extension for VS Code
|
15 | 17 | Open the command palette in VS Code (press <kbd>F1</kbd>) and run `Extensions: Install Extensions`. Enter `C#` in the search box and press `Enter`. Select the extension and click on `Install`.
|
16 | 18 |
|
17 | 19 | If you have previously installed the C# extension, make sure that you have a recent version. You can check this by opening the command palette (press <kbd>F1</kbd>) and running `Extensions: Show Installed Extensions`.
|
18 | 20 |
|
19 |
| -##### 4: Wait for download of platform-specific files |
20 |
| -The first time that C# code is opened in VS Code, the extension will download the platform-specific files needed for debugging and editing. Debugging and editor features will not work until these steps finish. |
21 |
| - |
22 |
| - |
23 | 21 | ### Once for each project
|
24 | 22 | The following steps have to be executed for every project.
|
25 | 23 | ##### 1: Get a project
|
@@ -73,37 +71,13 @@ If your code was built on a different computer from where you would like to run
|
73 | 71 | #### [Configurating launch.json for C# Debugging](debugger-launchjson.md)
|
74 | 72 |
|
75 | 73 | #### Attach Support
|
76 |
| -The C# debugger supports attaching to processes. To do this, switch to the Debug tab, and open the configuration drop down. |
77 | 74 |
|
78 |
| - |
79 |
| - |
80 |
| -Select the '.NET Core Attach' configuration. Clicking the play button (or pressing <kbd>F5</kbd>) will then try to attach. In launch.json, if `processId` is set to `""` this will provide UI to select which process to attach to. |
| 75 | +See the [official documentation](https://code.visualstudio.com/docs/csharp/debugging#_attaching-to-a-process). |
81 | 76 |
|
82 | 77 | #### Remote Debugging
|
83 | 78 |
|
84 | 79 | The debugger supports remotely launching or attaching to processes. See [Attaching to remote processes](https://github.com/dotnet/vscode-csharp/wiki/Attaching-to-remote-processes) in the wiki for more information.
|
85 | 80 |
|
86 | 81 | #### Exception Settings
|
87 | 82 |
|
88 |
| -The VS Code .NET debugger supports configuration options for if the debugger stops when exceptions are thrown or caught. This is done through two different entries in the BREAKPOINTS section of the Run view: |
89 |
| - |
90 |
| - |
91 |
| - |
92 |
| -Note that the BREAKPOINTS section will be missing these entries until the first time that the folder has been debugged with the .NET debugger. |
93 |
| - |
94 |
| -Checking 'All Exceptions' will configure the debugger to stop when an exception is thrown. If Just My Code is enabled (which it is by default) the debugger will not break if an exception is internally thrown and caught in library code. Though if the exception is thrown in library code and returned to user code the debugger will break then. |
95 |
| - |
96 |
| -Checking 'User-Unhandled Exceptions' will configure the debugger to stop when an exception is caught in non-user code after having been thrown in user code or traveled through user code. Exceptions that become user-unhandled aren't always a problem, it could be that user code is implementing an API and is expected to raise an exception in this scenario, but it is often a problem. So, by default, the debugger will stop when an exception becomes user-unhandled. |
97 |
| - |
98 |
| -##### Exception Conditions |
99 |
| -Both checkboxes support conditions to break on only selected exception types. To edit the condition, click on the pencil icon (see image above) or right click on the entry and invoke 'Edit Condition'. The condition is a comma-separated list of exception types to break on, or if the list starts with '!', a list of exception types to ignore. |
100 |
| - |
101 |
| -Examples conditions: |
102 |
| - |
103 |
| -| Example condition value | Result | |
104 |
| -|-------------------------|--------| |
105 |
| -| System.NullReferenceException | This will break on just null reference exceptions. | |
106 |
| -| System.NullReferenceException, System.InvalidOperationException | This will break on both null reference exceptions and invalid operation exceptions. | |
107 |
| -| !System.Threading.Tasks.TaskCanceledException | This will break on all exceptions except for task canceled. | |
108 |
| -| !System.Threading.Tasks.TaskCanceledException, System.NotImplementedException | This will break on all exceptions except for task cancelled and not implemented. | |
109 |
| - |
| 83 | +See the [official documentation](https://code.visualstudio.com/docs/csharp/debugging#_stopping-on-exceptions). |
0 commit comments