Hacker News new | past | comments | ask | show | jobs | submit login

Is there a way to build a GUI app with .NET on Linux?

Will it be cross-platform?




Avalonia.

The UI isn't native, is a Skia canvass with drawn controls. But it'll work on basically every OS and it's pretty good.

Also, you're not writing JavaScript, so that's a win any day in my book.


Sounds like Flutter?


No it's way better than Flutter. Avalonia really works on desktop.. :). Also the model is WPF so whoever know a little bit of legacy .NET framework will be able to write Avalonia apps in no-time


I don't know any .net, and have never heard of this until now. Only stories with comments on HN are from eight years ago. Although I liked the screenshots on the linked site, it doesn't seem to have much buzz around it.

And unfortunately, the only stench I can't stand more than Google's is Microsoft's.


I do not follow buzz. I am an engineer by education and attitude and always try to investigate my options based on my needs and requirements. I use buzz only to drive me trough my investigations. In my case I had a desktop application that had to run on Windows and MacOs and needed support for Rich text format and rendering of custom graphs.

Following buzz I started to do a prototype with Flutter and stopped after a few days as I found out that most of the open source controls I was using had bugs on Windows Desktop. Then I moved to MAUI and discovered that in order to have some decent Rich Text support my only option was Blazor Hybdrid. Nedless to say I found bugs that prevented my prototype to work correctly. Then I moved to UNO and found that it doesn't have full Rich text format support. I was able to find some .NET open source libraries for doing text layout on Skia and with that I was able to find a partial solution that was however pretty complicated. Out of curiosity I investigated Avalonia and found that everything that I needed had full support. Being fluent in WFP I built the prototype in 3 days and I never looked back.

Your experience might vary depending on your fluency of WFP but I found that, considering Windows Desktop as a target platform, Flutter and MAUI are absolutely the worst options. In my opinion Uno is better than Avalonia when considering web application support but Avalonia has more coverage of the WPF api with respect to what Uno does for WinUi. And for sure marketing is the worst part of Avalonia while it is the BEST for MAUI and Flutter.


I use buzz merely as a proxy for community size, support, etc. Will have to try them out as you said to really know.


> Is there a way to build a GUI app with .NET on Linux?

yes

https://avaloniaui.net/


There was also a GTK package for Xamarin Forms which I've used https://github.com/xamarin/Xamarin.Forms/pkgs/nuget/Xamarin....

BUT That's now officially unsupported as all of Xamarin Forms is no longer supported and the MAUI replacement doesn't cover Linux nor does that look likely (MAUI is mired deep in problems due over-ambition, failure to resource and it seems a significant push in MS to use MAUI Hybrid aka web UIs within native apps).


I really don't get the push of Blazor everywhere instead of its original WebAssembly target.

It is like the Web folks, that don't get anything else, are now pushing where .NET goes, mostly since .NET is now under Azure org chart.

I have done Web and native since "forever", not everything has to be for everything.


Yes, .net is for azure cloud webapps, that's how modern software is made. Then wrap them in electron to make them native.


WebView2 would probably be the way to go, now... at least for Windows as the target.

https://www.electronjs.org/blog/webview2/


Even the "port to WinUI" from UWP for the PhotosApp, is in similar vein, making use of Webview2 instead of native Windows.

When Microsoft teams behave as such, why should we keep paying attention?

For native Windows, Forms, WPF, and even MFC is way better in VS tooling than WinUI C++.


I can't tell if this is sarcasm. I really hope it is


https://github.com/picoe/Eto

  - OS X: MonoMac or net6.0-
  - Linux: GTK+ 
  - Windows: Windows Forms (using GDI or Direct2D) or WPF
Gtk

  - Gtk3: https://github.com/GtkSharp/GtkSharp
  - Gtk4: https://github.com/gircore/gir.core


Yes. There are multiple UI projects that build on the WinUI 3 components in the Win App SDK.

There's the first party MAUI which is an updated version of Xamarin Forms. The two best-known third-party implementations are AvaloniaUI and Uno. I prefer Uno, it has more cross-platform targets.



There's this:

https://docs.tryphotino.io/Overview

Which lets you run Blazor (web framework) like a desktop UI across all major desktop platforms. Microsoft has MAUI/Blazor as a thing, but only targets Mac and Windows ATM, so Photino bridges the gap for Linux.

Photino lets you use anything other than just .NET but has pretty decent .NET support.


There is also Uno

https://platform.uno/


Create an ASP.NET Core web server embedded in a binary bundled with Electron and a React frontend. (jk)


That is how electron.NET basically works


Kind of suspected people might actually be doing that. “You may live to see man-made horrors beyond your comprehension.”


To be honest, if you use AOT you can get the .net component under 100mb with trimming so it isn’t that bad…

If you cared about disk or memory usage you wouldn’t use electron, anyway.


(i hardly know what i'm talking about so somebody else may have a better idea, but i'm here now so)

mingw is a GNU's header/library environment (tools too maybe?) to create windows compatible applications. So I'd look into searching mingw .net and/or mingw mono.

also, ask your favorite AI, they're good at this type of question so long as it's not up to the minute news




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: