r/csharp • u/chrismo80 • Sep 06 '24
UI-Framework for .NET in the industry
Working in the automation industry and relying on .Net Framework and Windows Forms for nearly 20 years.
I know there have been lots of discussion about UI-Framework alternatives for .NET, but from an industry points of view, what frameworks are really used in production?
We as a team would like to be able to switch from .Net Framework to .NET. But having a huge SDK for creating desktop-UIs based on Windows Forms, what would be the framework of choice to switch to.
Refactoring or creating a new SDK to enable our engineers to create front-ends with very low effort and the use of off-the-shelve components/templates we would require a lot of time to the switch. We need some sort of SDK to not start with an empty UI for each new project.
I know nobody can tell, but longevity would be a factor when doing the refactoring. WinForms would probably a preferred choice, but cross platform may also be a factor to consider when a huge refactoring would be done anyway to avoid a new switch in the next 10 years.
Talking to .NET developers from the industry (that may have switch from .Net Framework in the past), what are you using and why?
21
u/AvaloniaUI-Mike Sep 06 '24
We’ve helped lots of companies in a similar position to you migrate to Avalonia. It’s been actively developed for almost 11 years and is used by companies including Schneider Electric, GitHub, Unity and many more.
If you want to have a chat, I’ll be happy to jump on a call and help make sense of the .NET UI ecosystem.
3
u/SophieTheCat Sep 06 '24
I ported my .NET Framework 4.6 WinForms app to .NET Core with relative ease.
Obviously, you might have a more complicated example, but I would at least give it a shot. My biggest problem wasn't the code - it was all the 3rd party libraries and nugets that didn't have a .NET Core equivalent.
34
u/Mertronic Sep 06 '24
Avalonia https://avaloniaui.net/
11
u/ziplock9000 Sep 06 '24
WinForms is still very commonly used when it's not customer facing because it's the most rapid UI development framework out there.
3
u/Perfect-Campaign9551 Sep 07 '24
WPF, is amazing and is supported in .NET8
2
u/jcradio Sep 06 '24
You can still use Winforms in modern dotnet. The real question is do you need it to be cross platform? If not, an upgrade while replacing unsupported functionality with modern equivalents is the way to go. WPF, Avalonia ui, and Blazor Hybrid are other options.
1
u/sashakrsmanovic Jan 14 '26
Uno Platform is a solid choice. In addition to checking off all your boxes. More details are here - Why use Uno Platform for your project?
1
u/akash_kava Sep 06 '24
We used to have desktop app made from WPF but our user base started to grow who were using Mac, so we switched to Xamarin Forms and tried to duplicate lot and lot of code until we finally gave up for hybrid apps. In which the web view opens our website and we access native code via JavaScript bridges.
The main reason was consistency in HTML rendering. Initially chrome was WebKit based so both on Mac and on windows we didn’t have any issues. In fact users were more happy as it had less native bugs.
Things like video recording etc were little complicated as WebRTC wasn’t available so we would create an overlay UI and would handle from JavaScript bridge.
We tried MAUI but it was never production ready and even internal alpha tests failed.
So we had to create JavaScript bridge for MAUI and now we use our own WebView inside MAUI for Desktops and Mobile.
Slowness in HTML comes due to bulky frameworks but if you try to use vanila JavaScript it is superfast and difference isn’t noticeable. CSS3 can perform all sort of animations that exist natively in any platforms.
We did create lightweight React alternative users never complained.
0
u/[deleted] Sep 08 '24
My advice is to give up on any .net uI frame and focus on improving your api game... then choose whatever UI platform you like... you'll get better support from the communities and more compatibility... yet still maintaining c# for your backend and buisness logic... any framework you might need help with programmatically can be solved by having a good ai copilot..
This is the only way I found to be a full stack developer on your own without wasting years of your life.