Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't start c# debugger on Visual Studio Code

Scenario:
I'm trying to debug asp.net core project on Visual Studio Code under Sabayon Linux. When I hit F5, I'm getting the following message:

Run 'Debug: Download .NET Core Debugger' in the Command Palette or open a .NET project directory to download the .NET Core Debugger

Opening Command Pallette and choosing "Debug: Download .NET Core Debugger" does nothing.

Software versions:
Sabayon linux 16.07
dotnet --version 1.0.0-preview2-003121
Visual Studio Code 1.4.0
C# extension for VSC 1.3

launch.json

{
"version": "0.2.0",
"configurations": [
    {
        "name": ".NET Core Launch (console)",
        "type": "coreclr",
        "request": "launch",
        "preLaunchTask": "build",
        "program": "${workspaceRoot}/bin/Debug/netcoreapp1.0/myproject.dll",
        "args": [],
        "cwd": "${workspaceRoot}",
        "stopAtEntry": false,
        "externalConsole": false
    },
    {
        "name": ".NET Core Launch (web)",
        "type": "coreclr",
        "request": "launch",
        "preLaunchTask": "build",
        "program": "${workspaceRoot}/bin/Debug/<target-framework>/<project-name.dll>",
        "args": [],
        "cwd": "${workspaceRoot}",
        "stopAtEntry": false,
        "launchBrowser": {
            "enabled": true,
            "args": "${auto-detect-url}",
            "windows": {
                "command": "cmd.exe",
                "args": "/C start ${auto-detect-url}"
            },
            "osx": {
                "command": "open"
            },
            "linux": {
                "command": "xdg-open"
            }
        },
        "env": {
            "ASPNETCORE_ENVIRONMENT": "Development"
        },
        "sourceFileMap": {
            "/Views": "${workspaceRoot}/Views"
        }
    },
    {
        "name": ".NET Core Attach",
        "type": "coreclr",
        "request": "attach",
        "processId": "${command.pickProcess}"
    }
]

}

like image 812
John Smith Avatar asked Oct 30 '22 22:10

John Smith


1 Answers

BugFinder's comment helped me resolve the same issue on Visual Studio Code under Debian 9:

  1. Delete the entire csharp extension directory at ~/.vscode/extensions/ms-vscode.csharp- and then reinstall the latest version of C# extension
  2. View the status of the debugger installation in the Ouput Panel (View -> Toggle Output) and select "Razor Log" option
  3. Fix all possible issues found there (for me "libunwind8" dependency was missing and actual fix was to run 'sudo apt-get install libunwind8')
  4. Restart Visual Studio Code
like image 149
Vladimir Efimenko Avatar answered Nov 13 '22 01:11

Vladimir Efimenko