Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How do you write C# for mac?


Official SDK for macOS (make sure to pick the right one, arm64 or x64): https://dotnet.microsoft.com/en-us/download/dotnet/7.0

Then, an IDE of your preference:

- VS Code: install C# extension and Roslynator (it adds useful analyzers)

- Rider: provides everything out of box, is more user-friendly (especially for people who used to big and fully-fledged solution) and has much superior debugging capabilities but is paid and has higher memory and battery consumption


Thanks, is there any way to do this without an IDE? I use vim

And before someone says "that's impossible, even vanilla macOS development forces you to use Xcode", nope that's not true. You can compile macOS apps with clang just fine.


You can probably use omnisharp-vim (OmniSharp is the same tech that powers VS Code's C# experience).

https://github.com/OmniSharp/omnisharp-vim


Via .NET, which has been cross platform since 2016 or so (before that Mono was the preferred framework).

For the UI bit, I'd recommend Avalonia UI (which is what Ryujinx uses as well). It's cross platform, has been out forever (2013 - from their FAQ page) and even runs on embedded devices.

Rider (by JetBrains) has excellent Avalonia support via a plugin and is much better for other .NET stuff over Visual Studio for Mac.


Relevant aside: while the Ryujinx Avalonia UI has more features and is generally nicer, due to a small number of outstanding issues, Ryujinx uses an older GTK+ UI in its default builds.

Avalonia builds are, however, readily available with each release, and auto-update just like standard GTK+ builds.

See the project FAQ[1] for full details.

[1] https://github.com/Ryujinx/Ryujinx/wiki/FAQ-and-Troubleshoot...


The same way you write it for Windows and Linux, .NET has been cross platform for almost a decade


Rider is pretty good as an IDE, and .Net works on both M1/2 ARM as well as X64 macOS.


The same way you write it for anything else. Why would it be different?


You can write C# in VS Code. It's not the best-ever experience, but it's workable. If you just mean getting it running, .NET is cross-plat.


> It's not the best-ever experience, but it's workable

It's pretty damn good, IMO. Been using it personally building some rather large projects.

The only time I miss Rider is when doing refactoring (Rider still much better for that) and code suggestions. Otherwise, VS Code is a great editor for C# IME.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: