Visual studio code, debug C# in windows

Visual Studio Code is a lightweight but powerful cross-platform source code editor support C++, C#, Python, PHP and other languages.

For debug C# code do next steps.

  1. Download and install .NET Core (https://www.microsoft.com/net/download/core) for your OS x64 or x86.
  2. Run Visual Studio Code, install C# extension and restart VSC editor.

  3. Initialize a C# project:

    Open folder where you’d like to create the C# project.

    Open Terminal (Ctrl+`), run command “dotnet new” and wait when VSC create project. After that, if you look in your folder, you can fond Programm.cs file with simple hello world C# code.

    Resolve the build assets by typing “dotnet restore”

    Now you can type “dotnet run” in terminal for compile and run project

  4. Now restart you VSC editor and if you have missing extensions, VSC automatically download and install him.
  5. Go to the debug view (Ctrl+Sift+D) and add .NET Core configuration. Select “.NET Core Launch (console)” configuration on debug drop down list and edit him.
  6. Now you can start debugging (F5) your code.

2 Comments

  • Sal says:

    Heya! I just wanted to ask if you ever have any trouble with hackers?
    My last blog (wordpress) was hacked and I ended up losing months of hard work due to no back up.
    Do you have any methods to protect against hackers?

Leave a Comment