dotnet / vscode-csharp

Official C# support for Visual Studio Code
MIT License
2.85k stars 670 forks source link

Announcement: Plugin has limited support on ARM devices #4348

Open cartermp opened 3 years ago

cartermp commented 3 years ago

Using this issue to track an announcement.

This plugin is not currently supported on ARM-based devices. If you find that something doesn't work for you, please check out the below issues first before filing a new one:

Linux: https://github.com/OmniSharp/omnisharp-vscode/issues/2771 macOS: https://github.com/OmniSharp/omnisharp-vscode/issues/4277 -- This can be addressed by updating macOS macOS: https://github.com/OmniSharp/omnisharp-vscode/issues/4605 -- This can be addressed by installing Rosetta macOS: https://github.com/OmniSharp/omnisharp-vscode/issues/4343 Windows: https://github.com/OmniSharp/omnisharp-vscode/issues/3006 Windows: https://github.com/OmniSharp/omnisharp-vscode/issues/3005

We're aware of the lack of support, and we're currently in the process of auditing tooling support across the .NET tooling stack on ARM-based devices to develop a better understanding of where the issues lie. When work to address those issues gets prioritized and done, we'll update this and other issues.

lokinfey commented 3 years ago

11 days pass .......... I think we need to know the roadmap about that , coz arm64 devices will more and more use for developer

lokinfey commented 3 years ago

any news about that ..... I think many .NETer need to use local debug in arm devices

JohnGalt1717 commented 3 years ago

We really need this. Until this is viable using .NET as a hobbyist on a raspberry pi is not viable. We need to be able to use remote-ssh in vs code and code against it and run and debug on it.

Zaneris commented 3 years ago

Picked up the Pi400 recently and it'd be great to have intellisense support so that we can work with the GPIO from C#/.NET for local development.

BlueStaggo commented 3 years ago

.NET Core's goal of being cross-platform is very great. OmniSharp should follow this too. I have .NET 5 on my Raspberry Pi, but I can't use this extension. I tried MonoDevelop one time, but that broke for no reason, even though Mono worked perfectly. I have a feeling Mono will be outdated in a year due to what .NET is becoming.

yosifovdimitar commented 3 years ago

Not working on ARM64 as well, hope we get some love soon :)

sanme98 commented 3 years ago

We really need this. Until this is viable using .NET as a hobbyist on a raspberry pi is not viable. We need to be able to use remote-ssh in vs code and code against it and run and debug on it.

If you're using remote-ssh, why not using remote debugging. OmniSharp-VSCode is supported remote debugging in ARM & ARM64.

https://github.com/OmniSharp/omnisharp-vscode/wiki/Remote-Debugging-On-Linux-Arm

coolqingcheng commented 3 years ago

Strong desire to native support Apple Silicon

KaungZawHtet commented 2 years ago

+1 for ARM devices. Millions of M1 Macbook pro and Arm-based Windows Laptops are coming into the market now.

sanme98 commented 2 years ago

.NET Core's goal of being cross-platform is very great. OmniSharp should follow this too. I have .NET 5 on my Raspberry Pi, but I can't use this extension. I tried MonoDevelop one time, but that broke for no reason, even though Mono worked perfectly. I have a feeling Mono will be outdated in a year due to what .NET is becoming.

If you just want an autocomplete C# editor, you can try Omnisharp-Vim. You can refer to this blog post for the setup > https://mycsharpdeveloper.wordpress.com/2021/10/19/setting-up-a-csharp-autocomplete-ide-using-vim-on-pi-64-bit/

JoeRobich commented 2 years ago

A prerelease build of the C# extension with experimental language server support for Linux Arm64 is available at https://github.com/OmniSharp/omnisharp-vscode/releases/tag/v1.23.18-beta1. You will need to set your "omnisharp.path" to "latest" as there is not a published release of O# for this platform. There is also no Razor language support in this build.

gregg-miskelly commented 2 years ago

In case it isn't obvious, this extension support Windows ARM64 and macOS ARM64 already.

neon-sunset commented 2 years ago

why does arm64 package still use amd64 version of mono?

zhen8838 commented 2 years ago

how to use dotnet instead the OmniSharp's mono? I use the dotnet run ominisharp.exe but will got

Could not load file or assembly 'System.Security.Permissions, Version=0.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
kbherbert commented 2 years ago

I recently installed the v1.24.0-beta1 pre-release alongside .NET 6 (ARM64) and "omnisharp.useModernNet": true. I can confirm that the dependency on the Mono process is no longer there when OmniSharp starts. Nice work!

neon-sunset commented 2 years ago

Actually, I got the ARM64 version working by simply downloading standalone omnisharp-roslyn from https://github.com/OmniSharp/omnisharp-roslyn/releases/tag/v1.38.0 and specifying its path for the VS Code extension instead of latest. It is also advantageous on x86_64 systems since it's no longer uses mono and has better performance. @kbherbert

zhen8838 commented 2 years ago

@neon-sunset how to set the path? I got error like:

Starting OmniSharp server at 1/3/2022, 4:46:08 PM
    Target: /Users/lisa/Documents/nncase/nncase.sln

[ERROR] Error: spawn /Users/lisa/Downloads/omnisharp-osx-arm64-net6.0/OmniSharp.dll EACCES
neon-sunset commented 2 years ago

You have to add an executable attribute to the file to make macOS happy: sudo chmod +x /Users/lisa/Downloads/omnisharp-osx-arm64-net6.0/OmniSharp.dll @zhen8838

filipw commented 2 years ago

The prerelease v1.24.0-beta1 does the following when you set "omnisharp.useModernNet": true:

It is recommended to move to this new extension and rely on the procedure described above. Adding executable attributes and using manually downloaded 1.38.0 OmniSharp with the current C# Extension only works by coincidence 😄

koliyo commented 2 years ago

Here is a short report of my efforts to try and do remote development with OmniSharp from an x64 Mac as client, and a M1 (arm64) iMac as the development server.

I am using the ms-dotnettools.csharp (C#) extension, version 1.24.0.

When I enable the extension on the remote host, it incorrectly downloads the x86_64 1.38.0 omnisharp package. And OmniSharp fails to start.

When running locally on the M1 iMac it correctly downloads the arm64 package.

So then I tried the following, which actually seems to work:

Manually copy the local extension directory to the remote-server directory on the M1 machine.

rm -r ~/.vscode-server/extensions/ms-dotnettools.csharp-1.24.0
cp -Rp ~/.vscode/extensions/ms-dotnettools.csharp-1.24.0 ~/.vscode-server/extensions/

This actually seems to work!

Now I get intellisense and debugging with breakpoints and exceptions, when doing remote ssh debugging from x64 Mac to M1 Mac!!

sschultze commented 2 years ago

With "Use Modern Net" disabled, everything works fine on my M1-based Mac. 🥰 - Despite some strange messages in the OmniSharp log such as "Received response for /findusages but could not find request." (same for /quickinfo)

With "Use Modern Net" enabled, OmniSharp does not even start unfortunately:

Unhandled exception. System.BadImageFormatException: Could not load file or assembly '/Users/stefan/.vscode/extensions/ms-dotnettools.csharp-1.24.1/.omnisharp/1.38.1-net6.0/OmniSharp.dll'. An attempt was made to load a program with an incorrect format.

JoeRobich commented 2 years ago

@sschultze When running on an M1 Mac we download an arm64 build of OmniSharp. Do you have the arm64 build of the dotnet SDK installed? Do you have the arm64 build of VS Code installed?

sschultze commented 2 years ago

@JoeRobich I had indeed installed a combination of VS Code arm64 and .NET 6 x64. I wasn't aware of this anymore 🙈, but I recall having had to do this because of otherwise not being able to use OmniSharp a longer time ago. (Not 100% sure.)

I have just removed .NET 6 x64 and installed the arm64 build instead, and also enabled "Use Modern Net" in OmniSharp. And everything I tested (IntelliSense, debugging etc.) seems to work fine. And noticeably faster than my old setup. 🚀 Thank you! 😊

riboyama commented 2 years ago

If you need blazor/razor language support on arm64 devices:

Clone razor-tooling v17.0-preview3 Change razor-tooling/src/Razor/src/rzls/rzls.csproj, add on line 8: osx-arm64 or linux-arm64.

Follow the razor-tooling build instructions

Go to the razor-tooling/src/Razor/src/rzls directory. Run: dotnet msbuild -restore -t:PublishAllRids -p:Configuration=Release

Copy the razor-tooling/artifacts/LanguageServer/Release/xxxx-arm64 to somewhere (writeable) on your device. In VSCode's settings.json set the razor language server directory and plugin path, e.g.:

"razor.languageServer.directory": "/home/ribo/rzls",
"razor.plugin.path": "/home/ribo/rzls/OmniSharpPlugin/Microsoft.AspNetCore.Razor.OmniSharpPlugin.dll"
andyleejordan commented 2 years ago

Just an update from me, I got everything working it seems with Windows 11 on ARM64 (specifically a Parallels VM on a macMini with their M1 processor). I was even able to use the "Debug Test" code lens on an xUnit test in the PowerShell Editor Services project. 🥳

Windows

Windows Version 22H2 OS Build 22621.160

VS Code

ARM Build

Version: 1.68.1 (user setup) Commit: 30d9c6cd9483b2cc586687151bcbcd635f373630 Date: 2022-06-14T12:49:00.318Z Electron: 17.4.7 Chromium: 98.0.4758.141 Node.js: 16.13.0 V8: 9.8.177.13-electron.0 OS: Windows_NT arm64 10.0.22621

OmniSharp

Extension v1.25.0, specifically installed the ARM64 build from the releases page (which did NOT appear to be what the marketplace automatically installed).

Settings:

"omnisharp.path": "latest",
"omnisharp.sdkIncludePrereleases": true,
"omnisharp.useModernNet": true

OmniSharp server started with .NET 6.0.301 Path: ~.vscode\extensions\ms-dotnettools.csharp-1.25.0.omnisharp\1.39.1-beta.2-net6.0\OmniSharp.dll

dotnet

.NET Core SDK v6.0.301, ARM64 build

Yay for forward progress!