Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
AAimson opened this issue Mar 18, 2017 · 32 comments
Closed

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

AAimson opened this issue Mar 18, 2017 · 32 comments
Assignees
Milestone

Comments

@AAimson
Copy link

AAimson commented Mar 18, 2017

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

@suqram
Copy link

suqram commented Mar 20, 2017

Got the same issue (also on Sierrs 10.12.4 beta)

@mikem8361
Copy link
Member

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

@Tesjkh
Copy link

Tesjkh commented Mar 28, 2017

When will it be available ? Thanks

@robbpriestley
Copy link

robbpriestley commented Mar 28, 2017

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?

@mikem8361
Copy link
Member

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.

@robbpriestley
Copy link

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?

@armartinez
Copy link

Is there a workaround for Visual Studio Mac ?

@mikem8361
Copy link
Member

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

@gregg-miskelly
Copy link
Contributor

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?

@suqram
Copy link

suqram commented Mar 29, 2017

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

@MacFriis
Copy link

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

@ealvesss
Copy link

@suqram it worked well!

Thanks

@swilliams-a3digital
Copy link

fix it for me!

@rosascarlos
Copy link

@suqram Excellent!
Work for me!
Thanks

@robvdveer
Copy link

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

@jhallam3
Copy link

@suqram Excellent!
Work for me!
Thanks

@kinliang
Copy link

Works for me too!

thanks!

@githubBrandon
Copy link

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

@mikem8361 what does this mean?

@mikem8361
Copy link
Member

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

@bryanross
Copy link

@suqram Work for me as well - thank you.

@rexlam0630
Copy link

@suqram Thanks so much! It works!

@robbpriestley
Copy link

Is this issue fixed in production now, or is it still in workaround? I noticed a new C# Extension and installed it yesterday. Does that contain the fix?

@LokeSonne
Copy link

@robbpriestley Sure seems like it. This is in the changelog for the extension in vs code:
What's New in 1.8.1
Fixes debugging on macOS Sierra 10.12.4.

(and it's working)
Brilliant!

@joristt
Copy link

joristt commented Apr 3, 2017

I did precisely what @suqram suggested, but now I get a popup when I try to run my application:

Debugger operation failed
Unknown Error: 0x92330062

I don't get the "Unable to attach to CoreCLR" message in my Application Output window anymore, so that's fixed. (and to clarify: when I run "dotnet" or "dotnet --info" , my results are identical to those from @AAimson)

@gregg-miskelly
Copy link
Contributor

@joristt if you have the 1.8.1 extension installed and you are still running into an issue, your issue isn't related to this issue. Please open a new issue, this issue is long enough :).

@robvdveer
Copy link

I was working on aspnet core when this issue started, and with VS preview it used to start a new Browser with a new debug session. Am i looking for the wrong setting now?

@joristt
Copy link

joristt commented Apr 3, 2017

@gregg-miskelly Yeah you're right, sorry :). You said

replace the version of vsdbg that VS for Mac is using

and I interpreted that as: replace only the vsdbg Unix executable. Tried copying everything from that zip to the VS Adapter directory 1 minute after commenting here and that fixed the problem.

@gregg-miskelly
Copy link
Contributor

@robvdveer by 'VS Preview' you mean 'VS For Mac Preview' correct? If so - VS For Mac hasn't shipped an update vsdbg package containing the fix yet (at least to my knowledge), so you are very likely at the right place. There are two work arounds posted above, but I will give you the latest version of it --

@robvdveer
Copy link

Thanks @gregg-miskelly for such a quick response!

@knilecrack
Copy link

@gregg-miskelly well played. Thanks

@akhilanair94
Copy link

@gregg-miskelly saved the day!!!!

@dreDevOS
Copy link

@gregg-miskelly this will work on the visual studio preview the debug gives an execution error

@msftgits msftgits transferred this issue from dotnet/coreclr Jan 31, 2020
@msftgits msftgits added this to the 2.0.0 milestone Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests