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

Mono implemented the GUI stuff like Windows Forms, do the latest windows cross platform stuff support that? Can you run .Net GUI windows program on linux without Mono but using the latest .Net thing ? I know it was not possible in the past.


The whole point of .NET-Core was to remove all the (largely desktop-oriented) platform-specific dependencies that tied it to Windows, so you could run server-oriented .net programs on Linux. So no, afaik you can't simply run GUI apps built with .Net on Linux desktops - that's the reason Mono wasn't simply killed, because it covers that niche (which wouldn't even exist, were it not for Mono/Xamarin's efforts back then. But I digress...). Nowadays there are a few other attempts at providing that UI layer.


.net Core still has Windows Forms thoguh? At least I (for kicks) migrated one of my old .net 4.something projects to .net core and it still works and shows the classic Windows Forms GUI.

It's (of course) not portable


.Net Core on Windows has support for loading assemblies that reference COM interfaces and the win32 API, along with other things that aren’t supported elsewhere like C++/CLI.

That’s why loading System.Windows.Forms still works, it’s not part of .Net 5+, but it can still load the assemblies on Windows (they still use GDI, etc under the hood).


System.Windows.Forms _is_ part of .NET 5+ — but only available on Windows.


You can use third party libs like Avalonia[1] or Uno[2]

[1] https://avaloniaui.net/ [2] https://platform.uno/


Sure, nobody wants to write Winforms new applications today

My point is about running existing applications on Linux, there are still issues with running .Net GUI stuff under wine and Mono was not a perfect implementation.

I read in other comments that the newer .Net cross platform stuff is not a replacement for Mono for running this old applications. (nobody will rewrite them to use the current GUI stuff from MS since are old apps)


No, Microsoft's .NET only supports WinForms on Windows. They do have an official cross platform GUI toolkit in MAUI, but it strangely does not support Linux.


Last I knew it is also considered pretty lackluster. Every time I read up on it it feels like, even beyond the lack of Linux support people just don't care for it.

If I was building a cross platform native app with .NET I'd probably use Avalonia right now.


Yeah, the took an age delivering it, then it came out and most of the early reports were “It’s still not ready.” and then I think Microsoft just gave up.

I think not supporting Linux was a tactical error, though. Some people will put up with a lot for Linux GUI support, and some of those people are the types who can resolve problems with your half-baked GUzi framework.


Oh yeah I agree lack of Linux support is a major issue. Just even without it there are so many other issues I dunno that Linux support helps much.


Does it really need help? I struggle to imagine a scenario where one would consider MAUI not supporting Linux to be an issue (if we discard superficial bad faith concern) when Avalonia, Uno or, if you care about Linux as the main target, Gir.Core exist.

And, at the end of the day, you have a tool with an extremely rich FFI capability so whatever is available from C you can use as well.


Sorry I clearly was not clear enough. I mean specifically an issue with MAUI itself. I agree dotnet/c# have some solid UI options cross platform at this point. MAUI however seems to be at best a mess and at worst dead in the water.


>but it strangely does not support Linux.

Support reasons. Still isn't the year of Linux Desktop.


> "The future is already here – it's just not evenly distributed."

Were I live and work (IT and consulting in central south-east Norway) it has been the year of the Linux Desktop on and off since 2009.

That was the first time I worked full time at a place that deployed Linux for everyone and everything that didn't have a verified reason for needing Windows.

I think we had one 3rd party trading software running on a Windows machine and maybe the CEO and someone in accounting got Windows.

Everyone else was upgraded to Linux and it worked beatifully. It was my job to support the sales department with desktop related issues and it was absolutely no problem to do it while also being a productive developer.

Since then I have not worked on a place that required Linux, but I think most of the places I have worked on since has had Linux as an option as long as you supported it yourself, and some places also have been very active writing how-tos and working with me to troubleshoot issues that were related to Linux, since many of them were also Linux users.

At the moment I use Mac, but at my current job I'm also allowed to use Linux.


Open Source Support reasons. If Linux developers want better MAUI support there is a "Community Repo" to contribute to and help move things further along. The impression is that if things were further along it might get formally "adopted" (by the Dotnet Foundation) for "official" out-of-the-box "support", but it isn't far enough along and doesn't seem to have enough contributors with enough momentum. It currently seems that the Venn Diagram of "Developers that say they want MAUI support for Linux" and "Developers that would contribute to Linux support for MAUI" has too small of an intersection.

Sure, Microsoft could pay more employees to work on it faster, but Linux loves and prefers open source from Linux devs "untainted by Microsoft", right?


Windows: it's cross platform! Looks inside "Except for Linux"

Huh


Contribute to the Maui backend for GTK and/or Qt, nothing is stopping you

Alternatively, just because you're on .NET doesn't mean you need to use Microsoft sanctioned UI toolkits, just as C++ has no "official" UI toolkit. You're free to pick up some GTK or Qt bindings if you want a native feeling and your application is already architectures correctly. Alternatively, throw Imgui at it if you just need dev tooling, or maybe try other cross platform toolkits in the ecosystem like Avalonia or Uno


I don't think it's very productive to contribute to projects that are the victim of strategic sabotage.


Reminds me of when Microsoft told Apple…I’ll let Wired break down “knifing the baby”…

https://www.wired.com/1998/11/knifing-the-baby/


For this, having wine in charge makes sense - though, as with many things wine you could be waiting a while.


I've had pretty good success running WinForms apps in wine, and just straight up installing latest version of dotnet in wine.

Works better in proton from my experience though, but I think that is due to making unity games run better


It is not perfect, there are issue depending if you need 32 or64 bits or if you need .net4 or greater. Games work but I have issues running tools like mod managers, game save cleners that are made with .net . In my case Sims3 works fine but not the Sims3 Launcher(this tools has more features then just launching the game like importing custom content/mods )

Sadly some Java tools stopped working if you run latest Java runtime because for some reason some crap was removed from Java and nobody made some easy way to add them back with soem package install.


With commercial applications that want to just take their existing code and have it run on Linux with only a couple lines changed, Avalonia XPF will do that


You are expected to use Avalonia or Uno for multi-platform targeting or Gir.Core (GTK4) or one of the many other binding libraries for Linux-specific GUI.

Also very easy to throw something together on top of SDL2 with Silk.NET.

Practically speaking it is in a much better place than many languages considered by parts of Linux community to be more """linux-oriented""".


My personal use case is running old GUI apps, I am not planning on writing GUI apps with .Net , MS had the opportunity to open source .Net/Silverlight and make money from tools but they bet on Windows and today most apps are node and javascript, a much inferior platform but MS open things up too late.


I think this is what you need now...

https://dotnet.microsoft.com/en-us/apps/maui

"Build native, cross-platform desktop and mobile apps all in one framework."

I know my buddy uses it to write Android apps on his Mac that interface to an ASP.NET Core web site.


I don't think that supports Linux tho


I had to check; you're right, no official support for Linux. Windows, macOS, iOS, Android. You can kludge Linux in with hacks.


Isn't it just another Xamarin rebrand?


No, they pretty much gave up on winforms when .net core morphed into "the" .net that is cross platform. There are some nice crossplatform gui libs now though.


Not really. Winforms have been updated to .net core. And a bunch of handy features to modernize it have been added.

I'd say it's the simplest and quickest way to go if you need to bang out a quickie app for Windows only.

https://learn.microsoft.com/en-us/dotnet/desktop/winforms/?v...


If true this would be huge. I got burned on the whole silverlight, Universal Windows Platform, WPF etc. All these new and improved solutions had all sorts of issues, no designer, no or weaker accessibility stories, bloated, slow etc etc. C# + Winforms would be appealing. Some of the performance with larger datasets in the new solutions (tables etc) was just surprising. I really feel like Microsoft got so distracted chasing phones, tables, touch etc they forget just basic line of business application development which they could and should have owned.


What are the ones to use in 2024? I used to code informs, it was a great improvement on its successors.


.net Core doesn't supply WinForms, but WPF is the far more common paradigm for Windows apps now. WPF is supported by projects like Avalonia on Linux. There are also a few other major alternative UI toolkits, more commonly used by cross-platform (vs Windows-exclusive) developers.


.NET Core does support Windows Forms just fine, but it’s only available on Windows.




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

Search: