-
Notifications
You must be signed in to change notification settings - Fork 687
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
Option to run the .NET Core debugger under Rosetta 2 when using the Apple Silicon version of VSCode #4277
Comments
I am assuming a workaround here is to use the x64 version of VS Code? |
@gregg-miskelly Yes, the x64 version of VS Code runs fine under Rosetta 2. But this workaround / VS Code x64 feels really slow on my MacBook Air M1. In contrast, the VS Code Exploration Build (native ARM) is incredibly fast. It's a pleasure to work with, I was really surprised. I assume that the .NET Core debugger runs in an external process anyway and does some inter-process communication with OmniSharp. Don't know where the warning is coming from, but I suspect that just letting the debugger run under Rosetta 2 (which happens automatically) would probably just work. |
@sschultze Thanks. Did you try debugging? My team doesn't have any M1 hardware yet to try. So it would be nice to confirm if it works. Yes, I don't think it would be too hard to support this scenario until we have a native version of the .NET SDK and a native version of the debugger. I am not sure if we would continue the support after that. My team will probably not try to fix this until we have hardware, but if you are interested in doing the probably small amount of work, I can try to dig up what you would need to change. |
Thank you for your offer to help. I was quite sure that I ran the debugger in VS Code x64 last midnight, but it seems that I had just launched the .NET process, without the debugger. When I tried to run the debugger in VS Code x64 now, I'm getting an exception (which seems to be well-known after some googling) - Stack overflow at HashHelpers.GetPrime(Int32). So, for the moment, a fix in OmniSharp wouldn't help unfortunately. But you probably like it to hear that C# code completion, navigation etc. works really fine from the ARM build of VS Code. |
Thanks! Looks like dotnet/runtime#44958 tracks the crash you ran into. |
I've been developing .NET 5 apps for the past 2 days using an M1 MacBook with native VSCode. The OmniSharp extension works perfectly well in the new M1 build of VSCode, actually! I'm happy to help test once the debugger itself is fixed. |
The Stack overflow at HashHelpers.GetPrime(Int32) problem is also mentioned by @khalidabuhakmeh here: Interestingly, Cameron Swarich @zwarich, the main developer of Rosetta 2 at Apple, is also commenting on this issue. I am also happy to help once the debugger is fixed. |
Issue dotnet#4277 This commit removes the bit of code that was preventing the .net debugger from starting on Apple Silicon. I've added a warning message that indicates that you might see unexpected issues when running this way. This should start working once macOS 11.1 is released next week. (See dotnet/runtime#44958 for more details)
Issue dotnet#4277 This commit removes the bit of code that was preventing the .net debugger from starting on Apple Silicon. I've added a warning message that indicates that you might see unexpected issues when running this way. This should start working once macOS 11.1 is released next week. (See dotnet/runtime#44958 for more details)
I just put up a PR that I think will get this working once macOS 11.1 is released. Supposedly .NET 5 debugging works with the rosetta fixes in that release. I'm not brave enough to run the macOS beta to find out, but 11.1 is supposed to be released shortly. |
* Allowing arm64 macOS to debug dotnet projects Issue #4277 This commit removes the bit of code that was preventing the .net debugger from starting on Apple Silicon. I've added a warning message that indicates that you might see unexpected issues when running this way. This should start working once macOS 11.1 is released next week. (See dotnet/runtime#44958 for more details) * Adding `arm64` to debug architectures
Wanted to leave an update here - on the latest beta of macOS Big Sur (11.2 beta 2) .NET 5 debugging works perfectly with VSCode and the omni sharp extension installed! I think this issue can be closed once 11.2 is released to the public. |
great to hear!!! |
Can't wait for this to be fixed so we can have Native VsCode for Blazor. |
@imflitch I believe this issue should actually be resolved already. You do need macOS 11.2. |
Issue Description
Steps to Reproduce
Use the current Apple Silicon (ARM) version of the Visual Studio Code Exploration build. Open a .NET 5 project and try to run the debugger.
Expected Behavior
The .NET Core debugger should run under Rosetta 2, just like it happens automatically when you run the "official" x64 version of Visual Studio Code under Rosetta 2.
Actual Behavior
A warning is displayed: "[WARNING]: Processor architecture 'arm64' is not currently supported by the .NET Core debugger. Debugging will not be available."
Logs
OmniSharp log
C# log
Environment information
VSCode version: 1.53.0-exploration
C# Extension: 1.23.7
Mono Information
OmniSharp using built-in monoDotnet Information
.NET SDK (reflecting any global.json): Version: 5.0.100 Commit: 5044b93829Runtime Environment:
OS Name: Mac OS X
OS Version: 11.0
OS Platform: Darwin
RID: osx.11.0-x64
Base Path: /usr/local/share/dotnet/sdk/5.0.100/
Host (useful for support):
Version: 5.0.0
Commit: cf258a14b7
.NET SDKs installed:
5.0.100 [/usr/local/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 5.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 5.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download
Visual Studio Code Extensions
The text was updated successfully, but these errors were encountered: