question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

System.BadImageFormatException starting omnisharp server (osx-arm64)

See original GitHub issue

Issue Description

Steps to Reproduce

  1. Install prerelease 1.24.0 from VSIX to VS Code.
  2. Observe output. Extension installs but Omnisharp server fails to start. Output:
Starting OmniSharp server at 1/15/2022, 4:01:18 PM
    Target: /Users/eck/Code/my-project

OmniSharp server started with .NET 6.0.100
.
    Path: /Users/eck/.vscode/extensions/ms-dotnettools.csharp-1.24.0/.omnisharp/1.38.1-beta.15-net6.0/OmniSharp.dll
    PID: 64647

Unhandled exception. System.BadImageFormatException: An attempt was made to load a program with an incorrect format.
 (0x8007000B)
[ERROR] Error: OmniSharp server load timed out. Use the 'omnisharp.projectLoadTimeout' setting to override the default delay (one minute).

Expected Behavior

Omnisharp server starts.

Actual Behavior

Omnisharp server does not start.

Logs

OmniSharp log

Post the output from Output-->OmniSharp log here

C# log

Post the output from Output-->C# here

Environment information

VSCode version: 1.63.2 C# Extension: 1.24.0

Mono Information OmniSharp using built-in mono
Dotnet Information .NET SDK (reflecting any global.json): Version: 6.0.100 Commit: 9e8b04bbff

Runtime Environment: OS Name: Mac OS X OS Version: 12.0 OS Platform: Darwin RID: osx-arm64 Base Path: /usr/local/share/dotnet/sdk/6.0.100/

Host (useful for support): Version: 6.0.0 Commit: 4822e3c3aa

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

.NET runtimes installed: Microsoft.AspNetCore.App 6.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 6.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
Extension Author Version
csharp ms-dotnettools 1.24.0
docomment k–kato 0.1.30
githistory donjayamanne 0.6.19
markdown-image-size bierner 0.0.4
remote-containers ms-vscode-remote 0.209.6
remote-ssh ms-vscode-remote 0.70.0
remote-ssh-edit ms-vscode-remote 0.70.0
sort-js-object-keys zengxingxin 1.0.6
terraform hashicorp 2.18.0
vscode-docker ms-azuretools 1.18.0
vscode-kubernetes-tools ms-kubernetes-tools 1.3.6
vscode-markdownlint DavidAnson 0.45.0
vscode-sort henriiik 0.2.5
vscode-yaml redhat 1.3.0

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:24 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
SaIGcommented, May 28, 2022

Had the same issue … and when installing the C# extension of vsCode it always downloaded the x64 version despite me having installed the arm64 dotnet version and deleted the x64 version.

Check if you have the old intel vscode version installed Bildschirmfoto 2022-05-28 um 12 01 44 It said Intel here for me first so thats why he downloaded the x64 omisharp tools after updating to the “apple branch” of vscode it said apple there and it downloaded the correct arm64 version of it.

hope this helps!

1reaction
DrBlackBirdcommented, Jan 21, 2022

I have the same error here. Without useModernNet Omnisharp loads but with the option enabled I receive the above error.

Read more comments on GitHub >

github_iconTop Results From Across the Web

.net - Omnisharp vscode - Unhandled exception. System ...
Unhandled exception. System.BadImageFormatException: Could not load file or assembly '/Users/benjamin/.vscode/extensions/ms-dotnettools.csharp- ...
Read more >
Hello OmniSharp on .NET 6.0! | StrathWeb. A free flowing web ...
On the next start, the .NET 6.0 OmniSharp build relevant for your platform (e.g. osx-arm64) will be downloaded and used from that point...
Read more >
C# is kinda messed up and I cant fix it - Unity Forum
System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (0x8007000B) [ERROR] Error: OmniSharp server ...
Read more >
OmniSharp - .NET and IntelliSense on any platform with your ...
OmniSharp is a family of Open Source projects, each with one goal - To enable great .NET development in YOUR editor of choice....
Read more >
omnisharp-vscode - Discover .NET
useModernNet is set to false . Windows: .NET Framework along with MSBuild Tools; MacOS/Linux: Mono with MSBuild. Get Started Writing C# ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found