Hacker News new | ask | show | jobs
by prahladyeri 1108 days ago
Following compatibility and standards is always good, irrespective of who does it. It'd be great if they supported running .NET and WinForms on Ubuntu some day, might actually happen who knows!
2 comments

Well, .NET is running on Ubuntu, if you consider .NET 5 upwards (previously .NET Standard/Core). In recent distributions it is even in the default package sources from Ubuntu. WinForms will never happen (although Mono's WinForms support was pretty good) as it targets the deprecated 4.6.x Framework.
That's great news! That means all .NET EXEs and DLLs will be cross-compatible with Ubuntu since 5.0? Mono had been doing substantial efforts since about a decade but was never the popular choice among Linux devs, mostly due to performance and other issues I think. With Microsoft themselves providing support, things must improve.

As for WinForms, there are probably newer alternatives like MAUI coming up since .NET core.

MAUI has had some growing pains and the rumors are that it's just a small team working on it at the moment. I think Microsoft may have bit off a bit more than they bargained for in part because they wanted to maintain a clear upgrade path for Xamarin.Forms and because they wanted to use native controls rather than just draw everything with Skia (like Flutter).

MAUI doesn't support Linux through official Microsoft channels, but there are people working on Linux support (I don't know what the state of that is at the moment).

.NET Core has been available on Linux for even longer then .NET 5. To make a long story short, Microsoft released .NET Core in 2016. Microsoft announced that .NET Core would be the future of .NET in 2019 and that .NET Framework (the old, proprietary, Windows-only .NET) would get security fixes and such, but wouldn't get any real updates. With .NET 5, Microsoft dropped the "Core" branding on .NET Core.

It's really easy to run things like .NET web services and such on Linux. You can even compile to a single binary.

Microsoft started retiring WinForms back in 2014. They open sourced it in 2018, but no one has really made adding support for non-Windows platforms a priority, especially since Microsoft put it into maintenance mode nearly a decade ago.

There are cross-platform GUI kits like AvaloniaUI and Uno Platform that some people like in addition to MAUI. Avalonia takes a Skia based approach like Flutter. Uno is a bit of a combination of Skia and some native widgets.

I sucessfully develop .NET REST APIs using ASP.NET Core since .NET 5 (and mostly using minimal APIs introduced in .NET 6) on my Mac using VSCode, Entity Framework Core (with Postgres+SQLite) and deploy it to Ubuntu VPSes. Flawless, and the only issue I ever encountered is rather fringe: I couldn't use AES128GCM algo for JWE token encryption, as it is only supported on Windows. Using the APIs on Linux/macOS will throw an Exception. I switched to AES128-CBC-HMAC instead for my JWE tokens, no big deal.
> That means all .NET EXEs and DLLs will be cross-compatible with Ubuntu since 5.0

Well, if compiled for the correct target framework, then yes. See https://learn.microsoft.com/en-us/dotnet/standard/frameworks

Note that .NET nowadays is cross-plattform, that means still you cannot just execute any dll/exe that uses plattform dependent code. This is the same as any other C/C++/Java program, once you program calls into OS library/kernel APIs, it is no longer cross-platform and those APIs have to exist on your target. So no, if you use any Win32 feature using P/Invoke, the tool will not just automagically run on Linux.

Yes. Besides desktop GUI applications, I would say Linux is the primary deploy platform for .NET services these days.
Look at AvaloniaUI, it’s .NET and basically an open source, cross platform WPF: https://avaloniaui.net/