vscode-csharp: All debugging broken on MacOS Sierra (10.12.4?)

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.0-rc3-004530)

Product Information:
 Version:            1.0.0-rc3-004530
 Commit SHA-1 hash:  0de3338607

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.12
 OS Platform: Darwin
 RID:         osx.10.12-x64
 Base Path:   /usr/local/share/dotnet/sdk/1.0.0-rc3-004530

VS Code version: Version 1.9.1 (1.9.1) C# Extension version: 1.7.0

Steps to reproduce

  1. Open dotnet core c# project
  2. Launch the debugger
  3. Wait for project to build

Expected behavior

The debugger launches and allows me to debug the code

Actual behavior

An error is returned in the output window:

--------------------------------------------------------------------------------
You may only use the Microsoft .NET Core Debugger (clrdbg) with Visual Studio
Code, Visual Studio or Visual Studio for Mac software to help you develop and
test your applications.
--------------------------------------------------------------------------------
ERROR: Unable to start debugging. Unexpected CLRDBG output from command "-exec-run".
The program '/Users/nicklasdemayo/aaa/projects-git/Service-BAHAdmin/BAH.Admin/bin/Debug/netcoreapp1.1/BAH.Admin.dll' has exited with code 42 (0x0000002a).

I ran the following (suggested from here):

/Users/nicklasdemayo/.vscode/extensions/ms-vscode.csharp-1.7.0/.debugger/clrdbg --interpreter=mi
-gdb-exit

And got no other unexpected output.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 53 (16 by maintainers)

Most upvoted comments

Here is a work around that worked for me:

  1. Download https://dotnet.myget.org/F/dotnet-core/api/v2/package/runtime.osx.10.10-x64.Microsoft.NETCore.Runtime.CoreCLR/1.1.2-servicing-25123-01
  2. Open the resulting file as a zip, and copy out runtimes/osx.10.10-x64/native/libdbgshim.dylib
  3. Open a terminal
  4. cd ~/.vscode/extensions/ms-vscode.csharp-1.8.0/.debugger
  5. cp <path-to-extracted-libdbgshim> .

As I said above, but just to repeat here, I expect to have a real fix out soon. But hopefully this will unblock folks in the mean time.

Version 1.8.1 has now been released to the extension gallery, and contains a fix for this issue. Thanks!

This issue is caused by an issue with a CoreCLR component. I opened https://github.com/dotnet/coreclr/issues/9730 to track the problem.

I believe the workaround mentioned above will help you solve the same issue. You can reference here: https://github.com/dotnet/coreclr/issues/10279 -> Haven’t tried this approach yet.

I ended up downloading the latest stable MacOS version from apple’s developer site and it installed back to the pre-beta version without effecting anything that was installed on my MacBook. With that this error was gone, no beta for me till this is resolved…