runtime icon indicating copy to clipboard operation
runtime copied to clipboard

Unable to debug on Visual Studio 2017 Mac (Sierra 10.12.4 Beta)

Open AAimson opened this issue 9 years ago • 32 comments

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

AAimson avatar Mar 18 '17 12:03 AAimson

Got the same issue (also on Sierrs 10.12.4 beta)

suqram avatar Mar 20 '17 21:03 suqram

This will be fixed in the next 1.0 and 1.1 service releases and has been fixed in the master branch.

mikem8361 avatar Mar 21 '17 17:03 mikem8361

When will it be available ? Thanks

Tesjkh avatar Mar 28 '17 11:03 Tesjkh

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?

wildforestnorth avatar Mar 28 '17 17:03 wildforestnorth

Here is a work around that worked for Gregg Miskelly:

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

mikem8361 avatar Mar 28 '17 17:03 mikem8361

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?

wildforestnorth avatar Mar 28 '17 18:03 wildforestnorth

Is there a workaround for Visual Studio Mac ?

armartinez avatar Mar 29 '17 06:03 armartinez

@gregg-miskelly Is there a workaround for VS for Mac?

mikem8361 avatar Mar 29 '17 17:03 mikem8361

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?

gregg-miskelly avatar Mar 29 '17 18:03 gregg-miskelly

This fixed it for me, in Visual Studio for Mac:

  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. Navigate to /Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/AddIns/DotNetCore.Debugger/Adapter/ in Finder or Terminal
  4. Rename libdbgshim.dylib to libdbgshim.dylib.old
  5. Paste in the new libdbgshim.dylib

suqram avatar Mar 29 '17 18:03 suqram

@suqram You just saved my day and night! Thx.

MacFriis avatar Mar 29 '17 19:03 MacFriis

@suqram it worked well!

Thanks

ealvesss avatar Mar 29 '17 20:03 ealvesss

fix it for me!

swilliams-a3digital avatar Mar 29 '17 22:03 swilliams-a3digital

@suqram Excellent! Work for me! Thanks

rosascarlos avatar Mar 30 '17 18:03 rosascarlos

Excellent, copying the libdbgshim file as instructed by @suqram did the trick.

robvdveer avatar Mar 30 '17 20:03 robvdveer

@suqram Excellent! Work for me! Thanks

jhallam3 avatar Mar 31 '17 09:03 jhallam3

Works for me too!

thanks!

kinliang avatar Mar 31 '17 09:03 kinliang

Open the resulting file as a zip, and copy out runtimes/osx.10.10-x64/native/libdbgshim.dylib

@mikem8361 what does this mean?

githubBrandon avatar Mar 31 '17 14:03 githubBrandon

A nuget file is a zip file. Rename to .zip and run unzip on it.

mikem8361 avatar Mar 31 '17 16:03 mikem8361

@suqram Work for me as well - thank you.

bryanross avatar Apr 01 '17 13:04 bryanross