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
*[Video Tutorial compiling with .NET Core](https://channel9.msdn.com/Blogs/dotnet/Get-started-with-VS-Code-using-CSharp-and-NET-Core)
20
20
21
-
### What's New in 1.7.0
21
+
### What's New in 1.8.0
22
22
23
-
*A brand new TextMate grammar written from scratch that provides much more robust C# syntax highlighting
24
-
*Better support for .NET Core .csproj projects, including .NET Core projects created with the latest [Visual Studio 2017 RC](https://www.visualstudio.com/vs/visual-studio-2017-rc/).
25
-
*Support for restoring NuGet packages in .NET Core .csproj projects.
26
-
*Improved code action support, including fixes like "Move Type to File" and "Generate Type".
23
+
*Added support for "Go to Implementation" and "Peek Implementation"
24
+
*Improvements to C# scripting support
25
+
*New architecture for the debugger
26
+
*Several breaking changes to remote debugging (see changelog for details).
27
27
* Lot's more!
28
28
29
-
See our [change log](https://github.com/OmniSharp/omnisharp-vscode/blob/v1.7.0/CHANGELOG.md) for all of the updates.
29
+
See our [change log](https://github.com/OmniSharp/omnisharp-vscode/blob/v1.8.0/CHANGELOG.md) for all of the updates.
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.
30
+
Open the command palette in VS Code (press <kbd>F1</kbd>) 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.
31
31
32
-
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 (F1) and running 'Extensions: Show Installed Extensions'.
32
+
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`.
33
33
34
34
##### 4: Wait for download of platform-specific files
35
35
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.
@@ -39,21 +39,21 @@ The first time that C# code is opened in VS Code, the extension will download th
39
39
The following steps have to executed for every project.
40
40
41
41
##### 1: Get a project
42
-
You can start from scratch by creating an empty project with `dotnet new`:
42
+
You can start from scratch by creating an empty project with `dotnet new`. Begin by opening the terminal in Visual Studio Code (`View->Integrated Terminal`) and type these commands:
43
43
44
44
cd ~
45
45
mkdir MyApplication
46
46
cd MyApplication
47
47
dotnet new
48
48
dotnet restore
49
49
50
-
If you want a web project (ASP.NET project) pass `-t web`. For web projects, makes sure to run `bower install` before running so that they can restore assets.
50
+
If you want a web project (ASP.NET project) use `dotnet new -t web`. For web projects, makes sure to run `bower install` before running so that they can restore assets.
51
51
52
52
##### 2: Open the directory in VS Code
53
-
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.
53
+
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.
54
54
55
55
##### 3: Add VS Code configuration files to the workspace
56
-
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.
56
+
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`.
57
57
58
58
* 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.
59
59
* 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.
@@ -62,30 +62,30 @@ If you open the folder containing your project.json, the C# extension can automa
62
62
63
63

64
64
65
-
Clicking 'Yes' on this prompt should add these resources.
65
+
Clicking `Yes` on this prompt should add these resources.
66
66
67
67
**Creating configuration files manually**
68
68
69
69
If your code has multiple projects or you would rather generate these files by hand, here is how --
70
70
71
-
**.vscode/tasks.json**: Start with [this example](https://raw.githubusercontent.com/wiki/OmniSharp/omnisharp-vscode/ExampleCode/tasks.json) which configures VS Code to launch 'dotnet build'. Update the 'cwd' property if your project isn't in the root of the open folder. 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.
71
+
**.vscode/tasks.json**: Start with [this example](https://raw.githubusercontent.com/wiki/OmniSharp/omnisharp-vscode/ExampleCode/tasks.json) which configures VS Code to launch `dotnet build`. Update the `cwd` property if your project isn't in the root of the open folder. 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.
72
72
73
-
**.vscode/launch.json**: 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. For example:
73
+
**.vscode/launch.json**: When you want to start debugging, press the debugger play button (or press <kbd>F5</kbd>) 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. For example:
Your project is now all set. Set a breakpoint or two where you want to stop, click the debugger play button (or hit F5) and you are off.
81
+
Your project is now all set. Set a breakpoint or two where you want to stop, click the debugger play button (or press <kbd>F5</kbd>) and you are off.
82
82
83
83
###Debugging Code compiled on another computer
84
84
If your code was built on a different computer from where you would like to run in there are a few things to keep in mind --
85
85
86
86
***Source Maps**: Unless your local source code is at exactly the same path as where the code was originally built you will need to add a [sourceFileMap](#source-file-map) to launch.json.
87
87
***Portable PDBs**: If the code was built on Windows, it might have been built using Windows PDBs instead of portable PDBs, but the C# extension only supports portable PDBs. See the [portable PDB documentation](https://github.com/OmniSharp/omnisharp-vscode/wiki/Portable-PDBs#how-to-generate-portable-pdbs) for more information.
88
-
***Debug vs. Release**: It is much easier to debug code which has been compiled in the 'Debug' configuration. So unless the issue you are looking at only reproduces with optimizations, it is much better to use Debug bits. If you do need to debug optimized code, you will need to disable [justMyCode](#just-my-code) in launch.json.
88
+
***Debug vs. Release**: It is much easier to debug code which has been compiled in the `Debug` configuration. So unless the issue you are looking at only reproduces with optimizations, it is much better to use Debug bits. If you do need to debug optimized code, you will need to disable [justMyCode](#just-my-code) in launch.json.
89
89
90
90
####More things to configure In launch.json
91
91
#####Just My Code
@@ -117,10 +117,14 @@ Environment variables may be passed to your program using this schema:
117
117
"myVariableName":"theValueGoesHere"
118
118
}
119
119
120
-
#####External console (terminal) window
121
-
The target process can optionally launch into a separate console window. You will want this if your console app takes console input (ex: Console.ReadLine). This can be enabled with:
120
+
#####Console (terminal) window
121
+
By default, processes are launched with their console output (stdout/stderr) going to the VS Code Debugger Console. This is useful for executables that take their input from the network, files, etc. But this does NOT work for applications that want to read from the console (ex: `Console.ReadLine`). For these applications, use a setting such as the following:
122
122
123
-
"externalConsole": true
123
+
"console": "integratedTerminal"
124
+
125
+
When this is set to `integratedTerminal` the target process will run inside [VS Code's integrated terminal](https://code.visualstudio.com/docs/editor/integrated-terminal). Click the 'Terminal' tab in the tab group beneath the editor to interact with your application.
126
+
127
+
When this is set to `externalTerminal` the target process will run in a separate terminal.
124
128
125
129
##### Stepping into properties and operators
126
130
The debugger steps over properties and operators in managed code by default. In most cases, this provides a better debugging experience. To change this and enable stepping into properties or operators add:
@@ -132,12 +136,8 @@ The C# debugger supports attaching to processes. To do this, switch to the Debug
132
136
133
137

134
138
135
-
Select the '.NET Core Attach' configuration. Clicking the play button (or pressing F5) will then try to attach. In launch.json, if `processId` is set to `"${command.pickProcess}"` this will provide UI to select which process to attach to.
136
-
137
-
#### Docker Support
138
-
139
-
Using Visual Studio Code and the C# extension it is also possible to debug your code running in a [Docker container](https://en.wikipedia.org/wiki/Docker_(software)). To do so, follow instructions to install and run [yo docker](https://github.com/Microsoft/generator-docker#generator-docker). This will add files to your project to build a container, and it will add a new debug launch configuration which will invoke a container build, and then debug your app in the container.
139
+
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 `"${command:pickProcess}"` this will provide UI to select which process to attach to.
140
140
141
141
#### Remote Debugging
142
142
143
-
In addition to Docker, it is also possible to setup the debugger to remotely attach or launch using other transports (ex: SSH). See [Attaching to remote processes](https://github.com/OmniSharp/omnisharp-vscode/wiki/Attaching-to-remote-processes) in the wiki for more information.
143
+
The debugger supports remotely launching or attaching to processes. See [Attaching to remote processes](https://github.com/OmniSharp/omnisharp-vscode/wiki/Attaching-to-remote-processes) in the wiki for more information.
0 commit comments