Respond to feedback for debugger.md

This makes some improvements to debugger.md based on feedback from Noah and Andrew.
This commit is contained in:
Gregg Miskelly 2016-04-11 17:23:18 -07:00
Родитель 434ed4e2ff
Коммит d4e111796d
1 изменённых файлов: 20 добавлений и 5 удалений

Просмотреть файл

@ -5,18 +5,23 @@ This page gives you detailed instructions on how to debug code running under .NE
File bugs and feature requests [here](https://github.com/OmniSharp/omnisharp-vscode/issues) and [join our insiders group](http://landinghub.visualstudio.com/dotnetcoreinsiders) to help us build great tooling for .NET Core.
####Requirements
* Only works with the RC2 version of .NET Core
* Requires .NET Core RC2 (will not work with earlier versions)
* X64 only
* Supports OSX, Ubuntu 14.04, Red Hat Enterprise Linux 7.2, Debian 8.2, Centos 7.1, and Windows 7+
###First Time setup
##### 1: Get Visual Studio Code
Install Visual Studio Code (VSC). Pick the latest VSC version from here: https://code.visualstudio.com Make sure it is at least 0.10.10.
Install Visual Studio Code (VSC). Pick the latest VSC version from here: https://code.visualstudio.com Make sure it is at least 0.10.10.
If you are not sure what version you have, you can see your version of VS Code:
* **OSX:** Code->Abort Visual Studio Code
* **Windows / Linux:** Help->Abort
##### 2: Install .NET command line tools
Install the .NET Core command line tools (CLI) by following the installation part of the instructions here: http://dotnet.github.io/getting-started
**Hint for Mac**: .NET Core requires openSSL to work. Don't forget this! Execute: `brew install openssl`
**OSX:** .NET Core requires openSSL to work. Don't forget this! Execute: `brew install openssl`
##### 3: Install C# Extension for VS Code
Open the command palette in VS Code (F1) and type "ext install C#" to trigger the installation of the extension. VS Code will show a message that the extension has been installed and it will restart.
@ -45,7 +50,10 @@ You can also find some example projects on https://github.com/aspnet/cli-samples
Go to File->Open and open the directory in Visual Studio Code. If this is the first time that the C# extension has been activated, it will now download additional platform-specific dependencies.
##### 3: Add VS Code configuration files to the workspace
VS Code needs to be configured so it understands how to build your project and debug it. For this there are two files which need to be added -- .vscode/tasks.json and .vscode/launch.json. Tasks.json is used to configure what command line command is executed to build your project, and launch.json configures the type of debugger you want to use, and what program should be run under that debugger. Launch.json also configures VS Code to run the build task from tasks.json so that your program is automatically up-to-date each time you go to debug it.
VS Code needs to be configured so it understands how to build your project and debug it. For this there are two files which need to be added -- .vscode/tasks.json and .vscode/launch.json.
* Tasks.json is used to configure what command line command is executed to build your project, and launch.json configures the type of debugger you want to use, and what program should be run under that debugger.
* Launch.json configures VS Code to run the build task from tasks.json so that your program is automatically up-to-date each time you go to debug it.
For most projects, the C# extension can automatically generate these files for you. When you open a project and the C# extension is installed, you should see the following prompt in VS Code:
@ -53,6 +61,8 @@ For most projects, the C# extension can automatically generate these files for y
Clicking 'Yes' on this prompt should add these resources.
**Creating configuration files manually**
In case you would rather generate .vscode/tasks.json by hand, you can start with [this example](https://raw.githubusercontent.com/wiki/OmniSharp/omnisharp-vscode/ExampleCode/tasks.json) which configures VS Code to launch 'dotnet build'. If you don't want to build from VS Code at all, you can skip this file. If you do this, you will need to comment out the 'preLaunchTask' from .vscode/launch.json when you create it.
In case you would rather generate .vscode/launch.json by hand, when you want to start debugging, press the debugger play button (or hit F5) as you would normally do. VS Code will provide a list of templates to select from. Pick ".NET Core" from this list and the edit the 'program' property to indicate the path to the application dll or .NET Core host executable to launch.
@ -78,10 +88,15 @@ Now open the configuration drop down from the top and select the one you want.
####More things to configure In launch.json
#####Just My Code
You can optionally disable justMyCode by setting it to "false".
You can optionally disable justMyCode by setting it to "false". You should disable Just My Code when you are trying to debug into a library that you pulled down which doesn't have symbols or is optimized.
"justMyCode":false*
Just My Code is a set of features that makes it easier to focus on debugging your code by hiding some of the details of optimized libraries that you might be using, like the .NET Framework itself. The most important sub parts of this feature are --
* User-unhandled exceptions: automatically stop the debugger just before exceptions are about to be caught by the framework
* Just My Code stepping: when stepping, if framework code calls back to user code, automaticially stop.
#####Source File Map
You can optionally configure a file by file mapping by providing map following this schema: