You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd rather have something new than WinForms, but I could not agree more on the eventual need for a platform-agnostic desktop UI. It's a rather obvious shortcoming.
Reacted by Petr Onderka, Andriy Savin, kmolerov, Wildan M, CatGirlsAreLife, Kevin Mark, Shimmy Weitzhandler, cdc-mgz4, Magnus Österlund, Lachlan Picking and 8 more
I'm glad to see the interest. We have heard interest from others for a UI solution with .NET Core, too.
At present, we don't have any plans to build a cross-platform UI stack. We do think that .NET Core is a good base for such a project and encourage others to collaborate on that. We are focused on server apps currently and will likely add IoT apps to that next.
The fact is that while Winforms could be considered obsolete it seems easy portable has been ported to Mono simply creating a wrapper of libGDI+ (the same thing is done here for System.Drawing), it exists a "try" to port Winforms to Net Core too: https://github.com/akoeplinger/mono-winforms-netcore.
But having the backing of Microsoft after this will do make things different obviously!
@jnm2 WPF has been proved impossible to port on Linux / MacOS (at least Mono never accomplished this), maybe Microsoft could make UWP portable?
@fanoI It is not "easy". Porting apps from .NET Framework WinForms to Mono WinForms has been proved to be painful and projects (Plastic) finally drop WinForms to embrace OS native UI framework (such as Xamarin.Mac). Typical WinForms apps use many P/Invoke and third party controls, which can be quite difficult to port.
WPF technically speaking can be ported to non-Windows OS, as its siblings such as XNA, Fire Monkey (for Delphi) have been ported. Mono never accomplishes that because they run out of resources, not because it cannot be done. There are other open source projects trying to port WPF over too, like Avalonia. Again, WPF apps can also use P/Invoke and third party controls.
@jnm2 You should check out Xamarin.Forms, which goes cross platform (iOS/Android/UWP/Tizen right now, and macOS/WPF coming), but that's not "platform-agnostic". It maps UI elements to native controls automatically so your apps blend in just like native apps, not aliens everywhere as the horrible Java apps. It also supports embedding native controls if you do need that capability.
@lextm I hate to write GUI code by hand... maybe I'm strange but I'm not interested if C#/VB.Net is automatically generated rather than XAML or well JSON but I want to design the windows graphically.
All the modern .Net UI frameworks are a step back respect to Winforms too in this aspect.
Interesting analysis on the current situation in your blog post, thank you!
@richlander the "port to core" label means that there is chance of this happening in the future?
@fanoI There is a chance. I think that @karelz added that label because that's the category of the work. I don't think he added it as an endorsement or the like. As I said, it isn't something we are focused on at the moment.
Personally, if I had any time to spare, it would be fun to do a native UI library from the ground up with all desktop platforms in mind. I've done a fair bit of native windows UI interop and once in a while winforms has gotten in the way more than anything. But realistically, that's a huge amount of work which needs an experienced team.
Winform exe's are cross platform, just launch with Mono runtime on linux/osx e.g. >mono ./hello.exe
You can develop in Visual studio and run on linux/mac using mono runtime
Prove it to yourself... Make a simple .sln Winform app, Target Dotnet 4.5. create form with button and label, create "hello world" to label on click event.
On Windows, click or launch from command line compiled file in solution from \bin
helloworld,exe
presto click button, -> hello world of course, works as expected
Copy same \bin\helloworld.exe to Linux/Mac/ Raspberry PI!!
To launch app on Linux/Mac, just prefix it with mono and use the './' before exe
Mono ./helloworld.exe
presto click button, -> hello world IT WORKS!
OMG it renders the form just like windows, and all the managed .net framework stuff just works...
To get latest version of mono for linux/mac
Check version.
I'm trying to use @yzrmn Winform on Linux (Cent OS7), I had a problem with the wrong path of libX11 that should have resolved but now I've got this exception:
Unhandled Exception: System.TypeInitializationException: The type initializer for 'System.Windows.Forms.WindowsFormsSynchronizationContext' threw an exception. ---> System.TypeInitializationException: The type initializer for 'System.Windows.Forms.XplatUI' threw an exception. ---> System.Resources.MissingManifestResourceException: Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "keyboards.resources" was correctly embedded or linked into assembly "System.CoreFX.Forms" at compile time, or that all the satellite assemblies required are loadable and fully signed.
Yeah, it currently works on Windows only, there are things that need to be done to make Unix work aswell. I'm hoping for constributions on this part :)
@2mik what allows the quick creation of GUI applications in WinForms is the designer, not the actual WinForms libraries, WinForms designer is just a hard-coded c# library that is mapping drag-and-drop input to c# code.
the difference between winforms and wpf, is that in wpf you can actually edit the GUI as a xaml + drag-and-drop designer but in winforms you are only limited to the drag-and-drop designer.
with that said i completely refuse wasting efforts on porting a 15+ years old un-maintained library, and instead focus on porting the maintained and battle-tested wpf framework
@bigworld12, I develop using both WinForms and WPF. WFP allows develop cool GUI. In real if you like creating clear layout, you have to edit XAML manually, like you do with HTML, that is difficult for inexperienced users. I work with guys whose primary skill is programming PLC. I'm sure they will never use WPF ))
In part my desire is realizing, Winform has been officially ported to Net Core: https://github.com/dotnet/winforms.
For now the code is Windows only but the question is as there is an already Mono version of it the two will be merged so to have a real xplat version of Winform?
There is WPF open sourced now too: https://github.com/dotnet/wpf.
In this case the question is: Microsoft will take the effort to make it xplat or at least will accept community PR to make this possible?
If I would want anything in .NET Core it would definitely not have been WinForms but rather WPF/UWP. Anyway, the truth is that I don't care so long as there will be a .NET UI Standard.
@weitzhandler You need to differentiate between existing applications with existing WinForms UI, which people would like to go cross platform (possibly using the WinForms implementation of Mono) and new projects (where I definitely would vote against using WinForms).
@fanoI Even if Microsoft won't take PRs for xplat WinForms/WPF, open sourcing the two allows whoever fond of that idea to fork and start their hacking immediately.
If we all waited for Microsoft to ship .NET for Linux and mobile, we shouldn't have seen Mono and Xamarin.
Reacted by Markus Schaber, CatGirlsAreLife and saint4eva
Activity
jnm2 commentedon Jul 3, 2017
I'd rather have something new than WinForms, but I could not agree more on the eventual need for a platform-agnostic desktop UI. It's a rather obvious shortcoming.
richlander commentedon Jul 3, 2017
I'm glad to see the interest. We have heard interest from others for a UI solution with .NET Core, too.
At present, we don't have any plans to build a cross-platform UI stack. We do think that .NET Core is a good base for such a project and encourage others to collaborate on that. We are focused on server apps currently and will likely add IoT apps to that next.
fanoI commentedon Jul 3, 2017
The fact is that while Winforms could be considered obsolete it seems easy portable has been ported to Mono simply creating a wrapper of libGDI+ (the same thing is done here for System.Drawing), it exists a "try" to port Winforms to Net Core too: https://github.com/akoeplinger/mono-winforms-netcore.
But having the backing of Microsoft after this will do make things different obviously!
@jnm2 WPF has been proved impossible to port on Linux / MacOS (at least Mono never accomplished this), maybe Microsoft could make UWP portable?
lextm commentedon Jul 3, 2017
@fanoI It is not "easy". Porting apps from .NET Framework WinForms to Mono WinForms has been proved to be painful and projects (Plastic) finally drop WinForms to embrace OS native UI framework (such as Xamarin.Mac). Typical WinForms apps use many P/Invoke and third party controls, which can be quite difficult to port.
WPF technically speaking can be ported to non-Windows OS, as its siblings such as XNA, Fire Monkey (for Delphi) have been ported. Mono never accomplishes that because they run out of resources, not because it cannot be done. There are other open source projects trying to port WPF over too, like Avalonia. Again, WPF apps can also use P/Invoke and third party controls.
@jnm2 You should check out Xamarin.Forms, which goes cross platform (iOS/Android/UWP/Tizen right now, and macOS/WPF coming), but that's not "platform-agnostic". It maps UI elements to native controls automatically so your apps blend in just like native apps, not aliens everywhere as the horrible Java apps. It also supports embedding native controls if you do need that capability.
Updated: Just wrote a blog post to cover most cross platform approaches and the frameworks that I know of. It is still far from the truth but hope it can get you familiar with the current status.
fanoI commentedon Jul 3, 2017
Xamarin.Forms has a GUI wysiwyg designer as WPF and Winforms?
lextm commentedon Jul 4, 2017
@fanoI Not exactly but close. It has a previewer now.
fanoI commentedon Jul 4, 2017
@lextm I hate to write GUI code by hand... maybe I'm strange but I'm not interested if C#/VB.Net is automatically generated rather than XAML or well JSON but I want to design the windows graphically.
All the modern .Net UI frameworks are a step back respect to Winforms too in this aspect.
Interesting analysis on the current situation in your blog post, thank you!
@richlander the "port to core" label means that there is chance of this happening in the future?
richlander commentedon Jul 4, 2017
@fanoI There is a chance. I think that @karelz added that label because that's the category of the work. I don't think he added it as an endorsement or the like. As I said, it isn't something we are focused on at the moment.
JimSEOW commentedon Aug 11, 2017
Instead of pushing WinForm, perhaps consider pushing Blend for Visual Studio 2017 to be compatible with XAML Standard
jnm2 commentedon Aug 11, 2017
Personally, if I had any time to spare, it would be fun to do a native UI library from the ground up with all desktop platforms in mind. I've done a fair bit of native windows UI interop and once in a while winforms has gotten in the way more than anything. But realistically, that's a huge amount of work which needs an experienced team.
Opzet commentedon Feb 22, 2018
.Net Core will rock if it has WYSIWYG Designer and it does Android + Win/Mac/Linux
Mind you the browser WebAssembly may change things? see Mono WebAssembly LLVM
Opzet commentedon Feb 22, 2018
Winform exe's are cross platform, just launch with Mono runtime on linux/osx e.g. >mono ./hello.exe
You can develop in Visual studio and run on linux/mac using mono runtime
Prove it to yourself... Make a simple .sln Winform app, Target Dotnet 4.5. create form with button and label, create "hello world" to label on click event.
Copy same \bin\helloworld.exe to Linux/Mac/ Raspberry PI!!
OMG it renders the form just like windows, and all the managed .net framework stuff just works...
To get latest version of mono for linux/mac
Check version.
//To upgrade mono.
These UI frameworks below just confuse the simplicity of cross platform WYSIWYG Winform
Mono has Cross platform Winform Win/Linux/Mac, its just missing Android.
yzrmn commentedon Apr 22, 2018
I already put some work into this: https://github.com/yzrmn/System.CoreFX.Forms
Contributions would be very welcome!
fanoI commentedon May 4, 2018
I'm trying to use @yzrmn Winform on Linux (Cent OS7), I had a problem with the wrong path of libX11 that should have resolved but now I've got this exception:
yzrmn commentedon May 4, 2018
Yeah, it currently works on Windows only, there are things that need to be done to make Unix work aswell. I'm hoping for constributions on this part :)
13 remaining items
bigworld12 commentedon Aug 31, 2018
@2mik what allows the quick creation of GUI applications in WinForms is the designer, not the actual WinForms libraries, WinForms designer is just a hard-coded c# library that is mapping drag-and-drop input to c# code.
the difference between winforms and wpf, is that in wpf you can actually edit the GUI as a xaml + drag-and-drop designer but in winforms you are only limited to the drag-and-drop designer.
with that said i completely refuse wasting efforts on porting a 15+ years old un-maintained library, and instead focus on porting the maintained and battle-tested wpf framework
devmikew commentedon Aug 31, 2018
That's not correct - one can edit the c# code and ignore the designer. Though it's non-trivial.
I agree that xaml would be better.
Xamarinforms is cross platform including android, iOS, Linux etc. Again, however it isnt simple.
Opzet commentedon Aug 31, 2018
I suggest you check out www.wisej.com
Winform Apps in the browser. Amazing stuff.
Buy me a beer later..
2mik commentedon Aug 31, 2018
@bigworld12, I develop using both WinForms and WPF. WFP allows develop cool GUI. In real if you like creating clear layout, you have to edit XAML manually, like you do with HTML, that is difficult for inexperienced users. I work with guys whose primary skill is programming PLC. I'm sure they will never use WPF ))
danmoseley commentedon Aug 31, 2018
@fanoI if this is now tracking cross-platform UI perhaps you could clarify that in the title.
fanoI commentedon Dec 5, 2018
In part my desire is realizing, Winform has been officially ported to Net Core: https://github.com/dotnet/winforms.
For now the code is Windows only but the question is as there is an already Mono version of it the two will be merged so to have a real xplat version of Winform?
There is WPF open sourced now too: https://github.com/dotnet/wpf.
In this case the question is: Microsoft will take the effort to make it xplat or at least will accept community PR to make this possible?
DickvdBrink commentedon Dec 5, 2018
@fanoI, for wpf and winforms the contribution.md explicitly states that it won't accept a PR for xplat.
https://github.com/dotnet/wpf/blob/3a696bc4fcfe4b8dd65ee856c9a089fa0ce13235/Documentation/contributing.md
weitzhandler commentedon Dec 5, 2018
If I would want anything in .NET Core it would definitely not have been WinForms but rather WPF/UWP. Anyway, the truth is that I don't care so long as there will be a .NET UI Standard.
markusschaber commentedon Dec 5, 2018
@weitzhandler You need to differentiate between existing applications with existing WinForms UI, which people would like to go cross platform (possibly using the WinForms implementation of Mono) and new projects (where I definitely would vote against using WinForms).
lextm commentedon Dec 5, 2018
@fanoI Even if Microsoft won't take PRs for xplat WinForms/WPF, open sourcing the two allows whoever fond of that idea to fork and start their hacking immediately.
stephentoub commentedon Mar 13, 2019
I'm going to close this issue as https://github.com/dotnet/winforms and https://github.com/dotnet/wpf are both now available, and there's no action to be taken in corefx.