vscodium: C# extension's debugging does not work 0x89720010

  1. Install Microsoft’s C# extension;
  2. Create a folder with a Hello World C# program and build it;
  3. Debug with the default Microsoft .NET Core Debugger (vsdbg) launch.json.

This message shows, and then nothing happens:

-------------------------------------------------------------------
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.
-------------------------------------------------------------------

#71 https://github.com/dotnet/core/issues/505 https://github.com/OmniSharp/omnisharp-vscode/issues/2491

Fix:

  • Easy Install omnisharp-vscode+netcoredbg extension (open-vsx.org) [src]

  • ⚠️Doesn’t work anymore⚠️ Advanced

    windows:

    {
    "version": "0.2.0",
    "configurations": [
            {
                "name": ".NET Core Launch (console)",
                "type": "coreclr",
                "request": "launch",
                "preLaunchTask": "build",
                "program": "${workspaceFolder}/bin/Debug/netcoreapp_your_ver/your_proj_name.dll",
                "args": [],
                "cwd": "${workspaceFolder}",
                "console": "integratedTerminal",
                "stopAtEntry": false,
                "internalConsoleOptions": "openOnSessionStart",
                "pipeTransport": {
                    "pipeCwd": "${workspaceFolder}",
                    "pipeProgram": "cmd",
                    "pipeArgs": ["/c"],
                    "debuggerPath": "C:\\\"Portable Bin\"\\netcoredbg\\netcoredbg.exe",
                    "quoteArgs": true
                }
            }
        ,]
    }
    

    linux, change this:

                    "pipeProgram": "bash",
                    "pipeArgs": ["-c"],
                    "debuggerPath": "/home/your_user_name/bin/netcoredbg/netcoredbg",
    

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 22
  • Comments: 16 (3 by maintainers)

Most upvoted comments

Hi @Harvzor I think this problem is not in VSCodium or plugin omnisharp-vscode. Problem in Microsoft license https://github.com/dotnet/core/issues/505 . VSCodium community is not obliged to keep track of all plugins/licenses/etc, if you don’t read the license terms, this is your problem.

Microsoft .NET Core Debugger (vsdbg) is not an open source product! Please read https://aka.ms/VSCode-DotNet-DbgLicense or alt URL.
@stripedpajamas Due to license restrictions, some plugins/libs are not supported and fully work only in VSCode(proprietary binary from Microsoft) … but this is obvious …

It’s great that there’s a well documented issue for this. However, this is a deal breaker when it comes to Codium.

I can’t expect my whole team to switch to using netcoredbg just because I want to run Codium (assuming I understand this solution correctly). It’s a shame they forced the more official solution to only work with Code.

I’d prefer if this issue was highlighted in the README.md so others like me don’t end up wasting some time on this issue.

I guess I’ll have to stick to Code. Thanks for the work otherwise!

As I am preparing to create a debugger extension for MonoDevelop based on Samsung debugger, I came across this thread (which of course is very valuable).

But I’d like to raise a concern that merely use pipeTransport settings as the first post indicated, might not fully resolve the licensing issue.

OmniSharp not only downloads Microsoft’s debugger (vsdbg), but also downloads other supporting files (like vsdbg-ui). When pipeTransport is used, I suspect that vsdbg-ui is still used by OmniSharp, which can still lead to a licensing issue (vsdbg does check if it runs by a valid IDE, but vsdbg-ui does not). Maybe the ultimate solution is to patch OmniSharp to use netcoredbg instead of vsdbg-ui.

Thanks for trying it out @Harvzor and thank you for your comment. I agree and will put a note in the README to hopefully save others from wasting any time 👍

Hi @ExceptionGit 👋

Thank you for this info!! Can you explain it a little more in-depth? Here is what I concluded, let me know where I am wrong:

  • MS’s C# extension only works with the VS Code product
  • Samsung also provides a C# debugger (?)
  • If you edit the launch.json file in your project, you can get C# debugging using the Samsung debugger (?)

Follow-up questions:

  • Is this C# extension problem happening on Windows/Linux and not Mac? Or is it happening across all platforms?
  • Is there a similar workaround for C++ projects to help #71

Thanks again for sharing this workaround 👍

Okay, so I tried this on a fresh machine with Manjaro. Installed VS Code and VS Codium (both v1.68). On VS Code I installed the official extension, and on VS Codium I installed the omnisharp-vscode+netcoredbg extension you linked (both v1.25). I tried debugging the same project in each one. I expect to get a debug terminal where I can interact with my program (e.g., so I can respond to Console.ReadLine()).

VS Code

launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": ".NET Core Launch (console)",
            "type": "coreclr",
            "request": "launch",
            "preLaunchTask": "build",
            "program": "${workspaceFolder}/bin/Debug/net6.0/HelloWorld.dll",
            "args": [],
            "cwd": "${workspaceFolder}",
            "console": "integratedTerminal",
            "internalConsoleOptions": "neverOpen",
            "stopAtEntry": false
        }
    ]
}

Screenshot

Project gets built in one terminal. As required, a separate terminal opens and runs vsdbg, and I can interact with the application in this terminal.

Screenshot_20220610_234428

VS Codium

launch.json

Notice that my debuggerPath option points to the netcoredbg binary installed with the extension, like you suggest.

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": ".NET Core Launch (console)",
            "type": "coreclr",
            "request": "launch",
            "preLaunchTask": "build",
            "program": "${workspaceFolder}/bin/Debug/net6.0/HelloWorld.dll",
            "args": [],
            "cwd": "${workspaceFolder}",
            "console": "integratedTerminal",
            "internalConsoleOptions": "openOnSessionStart",
            "stopAtEntry": false,
            "pipeTransport": {
                "pipeCwd": "${workspaceFolder}",
                "pipeProgram": "bash",
                "pipeArgs": [
                    "-c"
                ],
                "debuggerPath": "/home/murchu27/.vscode-oss/extensions/muhammad-sammy.csharp-1.25.0/.debugger/netcoredbg/netcoredbg",
                "quoteArgs": true
            }
        }
    ]
}

Screenshot

Project gets built in one terminal. No new terminal opens to launch netcoredbg, so I can’t interact with the program

Screenshot_20220610_235041

Analysis

Since vsdbg seems to be using some pipe files or something like that in /tmp, I checked to see if netcoredbg was doing something similar. Sure enough, the below files appeared after choosing “Run > Start Debugging” in VS Codium.

❯ ls /tmp/clr-debug-pipe*
/tmp/clr-debug-pipe-55252-2258222-in  /tmp/clr-debug-pipe-55252-2258222-out  /tmp/clr-debug-pipe-55260-2258227-in  /tmp/clr-debug-pipe-55260-2258227-out

I thought maybe I could troubleshoot this by connecting to these pipes with netcoredbg manually, similar to what VS Code does automatically for vsdbg. But I couldn’t figure out how to use them. vsdbg is using a --connection command line option to connect to its pipes, and netcoredbg doesn’t have this option.

Any ideas how I can properly debug this with netcoredbg? If this is veering into the realm of a new issue, I’m happy to open one. Just wanted to start here since people here have obviously gotten the debugger working for them.

Hi! Unless I’m missing something, these instructions do eliminate the original issue: F5 now runs without errors. But any breakpoints are ignored! The only way I can step through the code is by setting “stopAtEntry”: true because all the breakpoints I set are simply ignored when starting the aforementionned debuging launch profile.

I’m on latest patched win10 x64 , vscodium, c# extension, dotnetcore sdk and samsung debugger relases

thanks in advance ubidev

Awesome 👍

I will put this into a snippet on the Docs page for future reference. Thanks @ExceptionGit