3 ms·
How does C# fares in terms of portability these days? I checked years ago, and at the time, for non-Windows OSes you had to use Mono. But whether your applicati
by GTP 2y ago
How does C# fares in terms of portability these days? I checked years ago, and at the time, for non-Windows OSes you had to use Mono. But whether your application was going to work or not also depended on which graphic libraries you were using, e.g. WinForms wasn't going to work on Mono. At the time, C# was presented to me as a better Java, but to me it seemed that Java had true cross-platform compatibility while C# was going to work nicely only on Windows, unless you had some proper planning of checking beforehand which libraries were working with Mono.
- Rizu 2y agoyou should checkout AvalonuiaUI[0] or unoPlatform[1] if wanting to target web/mobile/window/linux/macOS if building for the web online, asp.net core runs on Linux servers as well as windows and there's MAUI [2] ( not a fan of this), you are better-off with with the others. in summary c# and .NET is cross-platform, third party developers build better frameworks and tools for other platform while Microsoft prefers to develop for Microsoft ecosystem, if you get [0] https://avaloniaui.net/ https://avaloniaui.net/ [1] https://platform.uno/ https://platform.uno/ [2] https://learn.microsoft.com/en-us/dotnet/maui/what-is-maui?view=net-maui-8.0 https://learn.microsoft.com/en-us/dotnet/maui/what-is-maui?v...
- smaudet 2y ago> and there's MAUI [2] ( not a fan of this), you are better-off with with the others. I will say MS has been obsessed with trying to take a slice of the mobile pie. However their Xamarin/WPF stuff left so much to be desired and was such a Jenga Tower that I totally get the community direction to go with a framework you have ostensibly have more control over vs learning that certain WPF elements are causes of e.g. memory leaks...
- CharlieDigital 2y agoVery good. I work at one of the few startups that uses C# and .NET. Dev machines are all M1/M3 MacBook Pros and we deploy to a mix of x64 and Arm64 instances on GCP and AWS. I use VS Code on macOS while the rest of the team prefers Rider. Zero friction for backend work and certainly more pleasant than Node. (We still use Node and JS for all front-end work).
- lwansbrough 2y ago.NET is totally cross platform these days. Our company develops locally on Windows and deploys to Linux. I’m the only team member on Mac and it works flawlessly.
- bluGill 2y agoIf you only care about linux on x86-64 or some ARM it is cross platform. Getting .net on FreeBSD is possible, but it isn't supported at all. QNX from what I can tell seems like it should be possible but a quick search didn't find anyone who succored (a few asked). My company has an in house non-posix OS useful for some embedded things, forget about it. There are a lot of CPUs out there that it won't work on. .NET has some small cross platform abilities, but calling it totally cross platform is wrong.
- lifthrasiir 2y agoThat's still pretty much cross-platform for all practical purposes, as it supports far more platforms than most softwares anyway. After all cross-platform only means that it runs on multiple platforms, not on all possible or even technically feasible platforms. Being cross-platform usually means a much easier porting but that porting still has to be done somehow.
- smaudet 2y ago> for all practical purposes In fairness this ignores a lot of embedded work. Java gets to cheat here a bit because they have some custom embedded stuff, but they are also not actually running on all CPUs.
- lifthrasiir 2y agoEmbedded stuffs require much more than mere cross-platform anyway ;-)
- sfn42 2y agoIf it doesn't run on TempleOS I dont want it (Jk I love C#)
- SirMaster 2y agoI mean since Mono it has completely changed. They are about to release .NET 9 which is the 8th version (there was no v4 to reduce confusion with the legacy .NET Framework) since being cross-platform. Mono was a third party glorified hack to get C# to work on other OS. .NET has been natively cross platform with an entirely new compiler and framework since mid 2016.
- GTP 2y ago> Mono was a third party glorified hack to get C# to work on other OS. Indeed, this is what I didn't like back then. Java has official support for other OSes, which C# was lacking at the time. Good to hear that things changed now.
- WorldMaker 2y agoBack in the day Mono had surprisingly good WinForms support on Gtk. It was never going to win awards for pretty and could never hit true compatibility with P/Invoke calls to esoteric Win32 APIs, but it was good enough to run any simple WinForms app you wanted to write for it and ran some of the "popular" ones just fine. (That old Mono WinForms support was recently donated to Wine, which seems like a good home for it.) .NET has moved to being directly cross-platform today and is great at server/console app cross-platform now, but its support for cross-platform UI is still relatively nascent. The official effort is called MAUI, has mostly but not exclusively focused on mobile, and it is being developed in the open (as open source does) and leaves a lot to be desired, including by its relatively slow pace compared to how fast the server/console app cross-platform stuff moves. The Linux desktop support, specifically, seems constantly in need of open source contributors that it can't find. You'll see a bunch of mentions of third-party options Avalonia and Uno Platform doing very well in that space, though, so there is interesting competition, at least.
- dachris 2y agoIf you're doing ASP.NET Core webdev, it's seamless. Runs in Linux docker containers. Developers in my team have either Windows (Visual Studio) or Linux or Mac (Rider) machines.
- giancarlostoro 2y agoWeird, I opened a binary I built years ago on Windows in Mono, and it was Winforms and rendered correctly, I think you mean WPF and the later GUI techs. Winforms renders nicely on Mono for a little while now I think? There's a lot of options, but also the latest of .NET (not Framework) just runs natively on Linux, Mac and Windows, and there's a few open source UI libraries as mentioned by others like Avalonia that allow your UI to run on any OS.
- GTP 2y agoThe issue at the time was having a WinForms application to run also on macOS, and IIRC at the time WinForms wasn't supported outside of Windows. Maybe Mono on Windows is still different from Mono on macOS. Anyway, the situation seem to be much better now. I'm not going to invest time into C# at the moment, since I'm in the Java ecosystem and Im currently taking some time to practice with Kotlin. But it's good to know that now C# is an option as well.
- giancarlostoro 2y agoForgot to include my OS: I ran a .NET (Framework? I think) .exe I built on Windows in 2020, on Linux with Mono and it worked and looked (aside from thematic differences) like I remembered it looking in 2024.
- GTP 2y agoNow that I thought a bit more about it, I think I unlocked a memory of WinForms working on some macOS versions and not others. Maybe it was even just supported on 32 bits versions and not in 64 bit versions. One way or another, the bottom line was that it wasn't going to work on the latest macOS version at the time. But I actually tried it on Linux and it worked there.