Skip to content

Commit

Permalink
Add Debug section to VS Code Getting Started (dotnet#1314)
Browse files Browse the repository at this point in the history
* Add Debug instructions
  • Loading branch information
kendrahavens authored Dec 9, 2016
1 parent 90fe68f commit 50ea2ee
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 2 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 24 additions & 2 deletions docs/csharp/getting-started/with-visual-studio-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ms.devlang: csharp
ms.assetid: 76c23597-4cf9-467e-8a47-0c3703ce37e7
---

# Getting started with Visual Studio Code
# Getting Started with Visual Studio Code

.NET Core gives you a fast and modular platform for creating server applications that run on Windows, Linux and macOS. Use Visual Studio Code with the C# extension to get a powerful editing experience with full support for C# IntelliSense (smart code completion) and debugging.

Expand All @@ -30,7 +30,7 @@ If you'd like to get started with a simple "Hello World" program on .NET Core, f

* Open VS Code.
* Go to the File Explorer Tab on the left.
* Open the folder you want you C# project to be in.
* Open the folder you want your C# project to be in.

![VSCodeOpenFolder](media/with-visual-studio-code/VSCodeOpenFolder.PNG)

Expand All @@ -47,6 +47,8 @@ If you'd like to get started with a simple "Hello World" program on .NET Core, f
* You'll see a new `project.lock.json` file in your project folder.
* This file contains information about your project's dependencies to make subsequent restores quicker.

> Tip: If you are using the MSBuild-based .NET Core Tools a .csproj will be created instead of a project.json, but the `dotnet` commands remain the same. [Read more](https://blogs.msdn.microsoft.com/dotnet/2016/11/16/announcing-net-core-tools-msbuild-alpha/).
![Image dotnet restore](media/with-visual-studio-code/dotnetRestore.PNG)

4. Run the "Hello World" program by typing `dotnet run`
Expand All @@ -55,3 +57,23 @@ If you'd like to get started with a simple "Hello World" program on .NET Core, f

You can also watch a short video tutorial for further setup help on [Windows](https://channel9.msdn.com/Blogs/dotnet/Get-started-with-VS-Code-using-CSharp-and-NET-Core), [macOS](https://channel9.msdn.com/Blogs/dotnet/Get-started-with-VS-Code-using-CSharp-and-NET-Core-on-MacOS), or [Linux](https://channel9.msdn.com/Blogs/dotnet/Get-started-with-VS-Code-Csharp-dotnet-Core-Ubuntu).

## Debug
1. Open Program.cs by clicking on it. The first time you open a C# file in VS Code omnisharp will load in the editor.

![OpenCS](media/with-visual-studio-code/OpenCS.PNG)
2. Open the Debug tab on the left side. The icon is a bug with a cancel line through it.
* You can also open the Debug tab by selecting View > Debug

![OpenDebug](media/with-visual-studio-code/OpenDebug.PNG)
2. Locate the green arrow at the top of the pane. Make sure the drop down next to it has `.NET Core Launch (console)` selected.

![SelectCore](media/with-visual-studio-code/SelectCore.PNG)
3. Add a breakpoint to your project by clicking in the space left of the line numbers in the editor.

![SetBreakpoint](media/with-visual-studio-code/SetBreakpoint.PNG)
4. Hit F5 or the green arrow to start debugging. The debugger stops execution of your program when it reaches the breakpoint you set in (3) above.
* While debugging you can view your local variables in the top left pane or use the debug console.

![RunDebug](media/with-visual-studio-code/RunDebug.PNG)
6. Hit the green arrow at the top to continue debugging or press the red square to stop.

0 comments on commit 50ea2ee

Please sign in to comment.