Unable to debug on Visual Studio 2017 Mac (Sierra 10.12.4 Beta)
When trying to debug a MVC Web project in VS 2017 Mac I get the error message: Unable to attach to CoreCLR.
dotnet
Microsoft .NET Core Shared Framework Host Version : 1.1.0
dotnet --info
.NET Command Line Tools (1.0.1)
Product Information: Version: 1.0.1 Commit SHA-1 hash: 005db40cd1
Runtime Environment: OS Name: Mac OS X OS Version: 10.12 OS Platform: Darwin RID: osx.10.12-x64 Base Path: /opt/dotnet/sdk/1.0.1
Got the same issue (also on Sierrs 10.12.4 beta)
This will be fixed in the next 1.0 and 1.1 service releases and has been fixed in the master branch.
When will it be available ? Thanks
Sierra 10.12.4 is now being pushed as an update by Apple. I installed the update this morning and now I can no longer debug in VS Code ("Unable to attach to CoreCLR."). I believe this is the same issue reported above. I installed the latest .NET Core SDK (dotnet --version now says 1.0.1). Is the fix available elsewhere, or any advice please?
Here is a work around that worked for Gregg Miskelly:
- 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
- Open the resulting file as a zip, and copy out runtimes/osx.10.10-x64/native/libdbgshim.dylib
- Open a terminal
- cd ~/.vscode/extensions/ms-vscode.csharp-1.8.0/.debugger
- cp
. 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.
Confirmed workaround works. Thanks for the info. When the real fix is released, will I need to "reverse" the workaround, or will installing the new software get me back to consistency?
Is there a workaround for Visual Studio Mac ?
@gregg-miskelly Is there a workaround for VS for Mac?
I don't have precise steps, but you can work around this by downloading https://vsdebugger.azureedge.net/coreclr-debug-1-9-0/coreclr-debug-osx.10.11-x64.zip, and replacing the version of vsdbg that VS for Mac is using with that version.
@DavidKarlas do you have better instructions?
This fixed it for me, in Visual Studio for Mac:
- 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
- Open the resulting file as a zip, and copy out runtimes/osx.10.10-x64/native/libdbgshim.dylib
- Navigate to /Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/AddIns/DotNetCore.Debugger/Adapter/ in Finder or Terminal
- Rename libdbgshim.dylib to libdbgshim.dylib.old
- Paste in the new libdbgshim.dylib
@suqram You just saved my day and night! Thx.
@suqram it worked well!
Thanks
fix it for me!
@suqram Excellent! Work for me! Thanks
Excellent, copying the libdbgshim file as instructed by @suqram did the trick.
@suqram Excellent! Work for me! Thanks
Works for me too!
thanks!
Open the resulting file as a zip, and copy out runtimes/osx.10.10-x64/native/libdbgshim.dylib
@mikem8361 what does this mean?
A nuget file is a zip file. Rename to .zip and run unzip on it.
@suqram Work for me as well - thank you.