Omnisharp-vscode: Debugger stops working right after debugging any .NET Core application on Manjaro

Created on 3 Feb 2019  路  7Comments  路  Source: OmniSharp/omnisharp-vscode

Environment data

dotnet --info output:

[perret@perret-pc ~]$ dotnet --info
.NET Core SDK (reflecting any global.json):
 Version:   2.2.102
 Commit:    96ff75a873

Runtime Environment:
 OS Name:     manjaro
 OS Version:  
 OS Platform: Linux
 RID:         arch-x64
 Base Path:   /opt/dotnet/sdk/2.2.102/

Host (useful for support):
  Version: 2.2.1
  Commit:  878dd11e62

.NET Core SDKs installed:
  2.2.102 [/opt/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.NETCore.App 2.2.1 [/opt/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download

VS Code version:

[perret@perret-pc ~]$ code --version
1.30.2
61122f88f0bf01e2ac16bdb9e1bc4571755f5bd8
x64

C# Extension version: 1.17.1
Omnisharp version 1.32.8

Omnisharp when opening Visual Studio Code with my project in the working directory:

Starting OmniSharp server at 2/3/2019, 11:36:15 AM
    Target: /home/perret/Desktop/Playground/CSharpmusement/Meow

OmniSharp server started with Mono 5.16.0.
    Path: /home/perret/.vscode-oss/extensions/ms-vscode.csharp-1.17.1/.omnisharp/1.32.8/omnisharp/OmniSharp.exe
    PID: 23375

[info]: OmniSharp.Stdio.Host
        Starting OmniSharp on manjaro 0.0 (x64)
[info]: OmniSharp.Services.DotNetCliService
        DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 2 MSBuild instance(s)
            1: Mono 15.0 - "/usr/lib/mono/msbuild/15.0/bin"
            2: StandAlone 15.0 - "/home/perret/.vscode-oss/extensions/ms-vscode.csharp-1.17.1/.omnisharp/1.32.8/omnisharp/msbuild/15.0/Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: Mono 15.0 - "/usr/lib/mono/msbuild/15.0/bin"
            CscToolPath = /home/perret/.vscode-oss/extensions/ms-vscode.csharp-1.17.1/.omnisharp/1.32.8/omnisharp/msbuild/15.0/Bin/Roslyn
            CscToolExe = csc.exe
[info]: OmniSharp.Cake.CakeProjectSystem
        Detecting Cake files in '/home/perret/Desktop/Playground/CSharpmusement/Meow'.
[info]: OmniSharp.Cake.CakeProjectSystem
        Could not find any Cake files
[info]: OmniSharp.WorkspaceInitializer
        Project system 'OmniSharp.DotNet.DotNetProjectSystem' is disabled in the configuration.
[info]: OmniSharp.MSBuild.ProjectSystem
        No solution files found in '/home/perret/Desktop/Playground/CSharpmusement/Meow'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/home/perret/Desktop/Playground/CSharpmusement/Meow/Meow.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in '/home/perret/Desktop/Playground/CSharpmusement/Meow'.
[info]: OmniSharp.Script.ScriptProjectSystem
        Could not find any CSX files
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpWorkspaceOptionsProvider
[info]: OmniSharp.WorkspaceInitializer
        Configuration finished.
[info]: OmniSharp.Stdio.Host
        Omnisharp server running using Stdio at location '/home/perret/Desktop/Playground/CSharpmusement/Meow' on host 23259.
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /home/perret/Desktop/Playground/CSharpmusement/Meow/Meow.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file '/home/perret/Desktop/Playground/CSharpmusement/Meow/Meow.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/home/perret/Desktop/Playground/CSharpmusement/Meow/Meow.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: Meow

Steps to reproduce

If needed, Install Arch / Manjaro and yay in order to easily install packages from AUR.

pacman -Sy yay
yay -S dotnet-sdk --noconfirm
yay -S mono --noconfirm
yay -S msbuild-stable --noconfirm
yay -S code --noconfirm

Then creating the default mvc or (console) solution and opening up Visual Studio Code, installing the C# extension, adding the default assets.

mkdir Meow
cd Meow
dotnet new mvc
code .

Install the C# extension
CTRL + SHIFT + P
ext install ms-vscode.csharp
[Restart if needed]

Download the .NET Code Debugger for the C# extension (if needed / not already done the first time)
CTRL + SHIFT + P
Debug: Download .NET Core Debugger

Generate the launch.json and tasks.json files (if not already answered yes to the popup shows: "Would you like to add the required assets to build and debug your project?")
CTRL + SHIFT + P
.NET: Generate Assets for Build and Debug

Debugging (.NET Core Launch (web))
CTRL + SHIFT + D
F5

Expected behavior

The debugging bar should remain active, the application should be running and open the web browser to the related address:port.

Actual behavior

The debugging bar shows up for 0.1 sec and then disappear, the application is not running (not action equivalent to a dotnet run) and no web browser is actually open.

Debugger

Most helpful comment

@gregg-miskelly good news: managed to make it work with... the code insiders version!

I managed to have everything working from scratch (Manjaro XFCE edition 18.02 on a live session):

Baby steps

  • Install yay to enjoy AUR without struggling with the command line: sudo pacman -Sy yay

  • Setup everything you need (aka the .NET Core SDK, Mono, MSBuild and Visual Studio Code Insiders): yay -S dotnet-sdk mono msbuild-stable visual-studio-code-insiders --noconfirm

  • Create a dummy project: dotnet new console

  • Start Visual Studio Code Insiders: code-insiders .

  • Install the C# extension
    CTRL + SHIFT + P
    ext install ms-vscode.csharp

  • Download the .NET Code Debugger for the C# extension (if needed / not already done the first time)
    CTRL + SHIFT + P
    Debug: Download .NET Core Debugger

  • Generate the launch.json and tasks.json files (if not already answered yes to the popup shows: "Would you like to add the required assets to build and debug your project?")
    CTRL + SHIFT + P
    .NET: Generate Assets for Build and Debug

  • Debugging (.NET Core Launch (console))
    CTRL + SHIFT + D
    F5

All 7 comments

@ehouarn-perret to make sure I understand, no error shows up in either VS Code (notification in the lower right) or in the debug console?

If so, can you grab a log: https://github.com/OmniSharp/omnisharp-vscode/wiki/Enabling-C%23-debugger-logging

@gregg-miskelly exactly, no error shows up in either VS Code or in the debug console.

About the log, here it is:

-> (C) {"command":"initialize","arguments":{"clientID":"vscode","clientName":"Code - OSS","adapterID":"coreclr","pathFormat":"path","linesStartAt1":true,"columnsStartAt1":true,"supportsVariableType":true,"supportsVariablePaging":true,"supportsRunInTerminalRequest":true,"locale":"en-us"},"type":"request","seq":1}
-> (C) {"command":"launch","arguments":{"name":".NET Core Launch (web)","type":"coreclr","request":"launch","preLaunchTask":"build","program":"/home/perret/Desktop/Playground/CSharpmusement/Meow/bin/Debug/netcoreapp2.2/Meow.dll","args":[],"cwd":"/home/perret/Desktop/Playground/CSharpmusement/Meow","stopAtEntry":false,"internalConsoleOptions":"openOnSessionStart","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","ASPNETCORE_URLS":"https://localhost:5001;http://localhost:5000"},"sourceFileMap":{"/Views":"/home/perret/Desktop/Playground/CSharpmusement/Meow/Views"},"logging":{"engineLogging":false},"__sessionId":"c7232537-28cb-4375-b2aa-d4d1bebac69f"},"type":"request","seq":2}
<- (E) {"seq":3,"type":"event","event":"output","body":{"category":"console","output":"-------------------------------------------------------------------\nYou may only use the Microsoft .NET Core Debugger (vsdbg) with\nVisual Studio Code, Visual Studio or Visual Studio for Mac software\nto help you develop and test your applications.\n-------------------------------------------------------------------\n"}}
-------------------------------------------------------------------
You may only use the Microsoft .NET Core Debugger (vsdbg) with
Visual Studio Code, Visual Studio or Visual Studio for Mac software
to help you develop and test your applications.
-------------------------------------------------------------------
<- (R) {"seq":4,"type":"response","request_seq":2,"success":true,"command":"launch"}
<- (E) {"seq":5,"type":"event","event":"initialized","body":{}}
<- (E) {"seq":6,"type":"event","event":"output","body":{"category":"telemetry","output":"VS/Diagnostics/Debugger/vsdbg/CommandFailed","data":{"VS.Diagnostics.Debugger.vsdbg.AdapterId":"coreclr","VS.Diagnostics.Debugger.vsdbg.ErrorCode":-1989017584,"VS.Diagnostics.Debugger.vsdbg.Distribution.Name":"d241e93b","VS.Diagnostics.Debugger.vsdbg.Command":"handshake","VS.Diagnostics.Debugger.vsdbg.OSFamily":"Linux","VS.Diagnostics.Debugger.vsdbg.Version":"16.0.11026.1 commit:87122b596f240c8c819a194d8f57eb6c749483b9"}}}
<- (R) {"seq":7,"type":"response","request_seq":3,"success":false,"command":"handshake","message":"Error processing 'handshake' request. Unknown Error: 0x89720010"}
-> (C) {"command":"setExceptionBreakpoints","arguments":{"filters":["user-unhandled"]},"type":"request","seq":4}
<- (R) {"seq":8,"type":"response","request_seq":4,"success":true,"command":"setExceptionBreakpoints"}
-> (C) {"command":"configurationDone","type":"request","seq":5}
<- (E) {"seq":9,"type":"event","event":"output","body":{"category":"telemetry","output":"VS/Diagnostics/Debugger/vsdbg/CommandFailed","data":{"VS.Diagnostics.Debugger.vsdbg.AdapterId":"coreclr","VS.Diagnostics.Debugger.vsdbg.ErrorCode":17001,"VS.Diagnostics.Debugger.vsdbg.Distribution.Name":"d241e93b","VS.Diagnostics.Debugger.vsdbg.Command":"handshake","VS.Diagnostics.Debugger.vsdbg.OSFamily":"Linux","VS.Diagnostics.Debugger.vsdbg.Version":"16.0.11026.1 commit:87122b596f240c8c819a194d8f57eb6c749483b9"}}}
<- (E) {"seq":10,"type":"event","event":"output","body":{"category":"telemetry","output":"VS/Diagnostics/Debugger/vsdbg/DebugCompleted","data":{"VS.Diagnostics.Debugger.vsdbg.AdapterId":"coreclr","VS.Diagnostics.Debugger.vsdbg.DebugCompleted.BreakCounter":0,"VS.Diagnostics.Debugger.vsdbg.Distribution.Name":"d241e93b","VS.Diagnostics.Debugger.vsdbg.OSFamily":"Linux","VS.Diagnostics.Debugger.vsdbg.Version":"16.0.11026.1 commit:87122b596f240c8c819a194d8f57eb6c749483b9"}}}
<- (R) {"seq":11,"type":"response","request_seq":5,"success":false,"command":"configurationDone","message":"Error processing 'configurationDone' request. Unknown Error: 0x89720010"}
-> (C) {"command":"disconnect","arguments":{"restart":false},"type":"request","seq":6}
-> (C) {"command":"threads","type":"request","seq":7}
<- (E) {"seq":12,"type":"event","event":"output","body":{"category":"telemetry","output":"VS/Diagnostics/Debugger/vsdbg/DebugCompleted","data":{"VS.Diagnostics.Debugger.vsdbg.AdapterId":"coreclr","VS.Diagnostics.Debugger.vsdbg.DebugCompleted.BreakCounter":0,"VS.Diagnostics.Debugger.vsdbg.Distribution.Name":"d241e93b","VS.Diagnostics.Debugger.vsdbg.OSFamily":"Linux","VS.Diagnostics.Debugger.vsdbg.Version":"16.0.11026.1 commit:87122b596f240c8c819a194d8f57eb6c749483b9"}}}
<- (R) {"seq":13,"type":"response","request_seq":6,"success":true,"command":"disconnect"}

I don't think those below are expected, right?

<- (E) {"seq":6,"type":"event","event":"output","body":{"category":"telemetry","output":"VS/Diagnostics/Debugger/vsdbg/CommandFailed","data":{"VS.Diagnostics.Debugger.vsdbg.AdapterId":"coreclr","VS.Diagnostics.Debugger.vsdbg.ErrorCode":-1989017584,"VS.Diagnostics.Debugger.vsdbg.Distribution.Name":"d241e93b","VS.Diagnostics.Debugger.vsdbg.Command":"handshake","VS.Diagnostics.Debugger.vsdbg.OSFamily":"Linux","VS.Diagnostics.Debugger.vsdbg.Version":"16.0.11026.1 commit:87122b596f240c8c819a194d8f57eb6c749483b9"}}}
<- (R) {"seq":7,"type":"response","request_seq":3,"success":false,"command":"handshake","message":"Error processing 'handshake' request. Unknown Error: 0x89720010"}
<- (E) {"seq":9,"type":"event","event":"output","body":{"category":"telemetry","output":"VS/Diagnostics/Debugger/vsdbg/CommandFailed","data":{"VS.Diagnostics.Debugger.vsdbg.AdapterId":"coreclr","VS.Diagnostics.Debugger.vsdbg.ErrorCode":17001,"VS.Diagnostics.Debugger.vsdbg.Distribution.Name":"d241e93b","VS.Diagnostics.Debugger.vsdbg.Command":"handshake","VS.Diagnostics.Debugger.vsdbg.OSFamily":"Linux","VS.Diagnostics.Debugger.vsdbg.Version":"16.0.11026.1 commit:87122b596f240c8c819a194d8f57eb6c749483b9"}}}
<- (E) {"seq":10,"type":"event","event":"output","body":{"category":"telemetry","output":"VS/Diagnostics/Debugger/vsdbg/DebugCompleted","data":{"VS.Diagnostics.Debugger.vsdbg.AdapterId":"coreclr","VS.Diagnostics.Debugger.vsdbg.DebugCompleted.BreakCounter":0,"VS.Diagnostics.Debugger.vsdbg.Distribution.Name":"d241e93b","VS.Diagnostics.Debugger.vsdbg.OSFamily":"Linux","VS.Diagnostics.Debugger.vsdbg.Version":"16.0.11026.1 commit:87122b596f240c8c819a194d8f57eb6c749483b9"}}}
<- (R) {"seq":11,"type":"response","request_seq":5,"success":false,"command":"configurationDone","message":"Error processing 'configurationDone' request. Unknown Error: 0x89720010"}

Correct. Do you have an official version of VS Code installed? Only official versions support .NET Debugging.

I am not sure why you aren't getting an error message for this. Sounds like the VS Code team may have broken something with their error handling.

As far as the word "official" goes: https://aur.archlinux.org/packages/visual-studio-code-bin
I don't have that issue when I am running the same thing against Ubuntu, so might come from a wide variety of factors.

@ehouarn-perret Thanks! You need to install the Official Microsoft copy from https://code.visualstudio.com/

@gregg-miskelly this is what this package provides, the tar.gz included in the AUR package is the official one, it just simplifies the installation on the given Linux distribution (Arch / Manjaro)

Actually, I can try directly with the archive (since it's the same) on the vs code website to show you that the end result is the same, will copy paste the log here.

@gregg-miskelly good news: managed to make it work with... the code insiders version!

I managed to have everything working from scratch (Manjaro XFCE edition 18.02 on a live session):

Baby steps

  • Install yay to enjoy AUR without struggling with the command line: sudo pacman -Sy yay

  • Setup everything you need (aka the .NET Core SDK, Mono, MSBuild and Visual Studio Code Insiders): yay -S dotnet-sdk mono msbuild-stable visual-studio-code-insiders --noconfirm

  • Create a dummy project: dotnet new console

  • Start Visual Studio Code Insiders: code-insiders .

  • Install the C# extension
    CTRL + SHIFT + P
    ext install ms-vscode.csharp

  • Download the .NET Code Debugger for the C# extension (if needed / not already done the first time)
    CTRL + SHIFT + P
    Debug: Download .NET Core Debugger

  • Generate the launch.json and tasks.json files (if not already answered yes to the popup shows: "Would you like to add the required assets to build and debug your project?")
    CTRL + SHIFT + P
    .NET: Generate Assets for Build and Debug

  • Debugging (.NET Core Launch (console))
    CTRL + SHIFT + D
    F5

Was this page helpful?
0 / 5 - 0 ratings