Skip to content

Improve error when opening C# project on an Apple Silicon M1 machine without Rosetta #4605

@miguellira

Description

@miguellira

Issue Description

During the start of the OmniSharp server a call using the built-in mono command returns a Bad CPU type in executable error.

Steps to Reproduce

On a new Apple Silicon M1 machine:

  1. Download and install the Mac Universal version of Visual Studio Code
  2. Download and install the preview version of .NET 6 (6.0.100-preview.4.21255.9)
  3. Create a new C# console project dotnet new console -n ConsoleApp
  4. Open ConsoleApp folder in Visual Studio Code

Expected Behavior

Project loads and C# language features (e.g. code completion) are available.

Actual Behavior

An error is returned in the OmniSharp log and C# features are unavailable.

Logs

OmniSharp log

Starting OmniSharp server at 6/11/2021, 7:28:11 AM Target: /Users/miguellira/Developer/ConsoleApp

OmniSharp server started.
Path: /Users/miguellira/.vscode/extensions/ms-dotnettools.csharp-1.23.12/.omnisharp/1.37.10/run
PID: 10636

/Users/miguellira/.vscode/extensions/ms-dotnettools.csharp-1.23.12/.omnisharp/1.37.10/run: line 27: /Users/miguellira/.vscode/extensions/ms-dotnettools.csharp-1.23.12/.omnisharp/1.37.10/bin/mono: Bad CPU type in executable
[ERROR] Error: OmniSharp server load timed out. Use the 'omnisharp.projectLoadTimeout' setting to override the default delay (one minute).

C# log

Installing C# dependencies... Platform: darwin, arm64

Downloading package 'OmniSharp for OSX' (37658 KB).................... Done!
Validating download...
Integrity Check succeeded.
Installing package 'OmniSharp for OSX'

Downloading package '.NET Core Debugger (macOS / x64)' (45875 KB).................... Done!
Validating download...
Integrity Check succeeded.
Installing package '.NET Core Debugger (macOS / x64)'

Downloading package '.NET Core Debugger (macOS / arm64)' (47834 KB).................... Done!
Validating download...
Integrity Check succeeded.
Installing package '.NET Core Debugger (macOS / arm64)'

Downloading package 'Razor Language Server (macOS / x64)' (60206 KB).................... Done!
Installing package 'Razor Language Server (macOS / x64)'

Finished

[WARNING]: arm64 macOS is not officially supported by the .NET Core debugger. You may experience unexpected issues when running in this configuration.

Environment information

VSCode version: 1.57.0
C# Extension: 1.23.12

Mono Information OmniSharp using built-in mono
Dotnet Information .NET SDK (reflecting any global.json): Version: 6.0.100-preview.4.21255.9 Commit: 950e4949a7

Runtime Environment:
OS Name: Mac OS X
OS Version: 11.4
OS Platform: Darwin
RID: osx.11.0-arm64
Base Path: /usr/local/share/dotnet/sdk/6.0.100-preview.4.21255.9/

Host (useful for support):
Version: 6.0.0-preview.4.21253.7
Commit: bfd6048a60

.NET SDKs installed:
6.0.100-preview.4.21255.9 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.0-preview.4.21253.5 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.0-preview.4.21253.7 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download

Visual Studio Code Extensions
Extension Author Version
csharp ms-dotnettools 1.23.12

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions