How do I compile a Windows.Forms application on Linux for .NET Core?
Jul 10
I can compile my application on Linux using mono mcs, but the result is an executable for .NET Framework 4.5. On windows it runs but I cannot use any newer functionality.
I tried to find out how to compile it with .NET SDK 5.0 but on Linux it seems to not include Windows Forms.
Is there a way to compile a forms application on Linux which uses at least .NET Core 2.0?
1 answer
Accepted answer · original discussion
Jul 10
Windows Forms (and WPF) are both not supported on Linux with .NET Core and probably never will be. Winforms runs on mono, but that is based on .NET Framework, not .NET Core. The reason is mostly because the internal implementation of Windows Forms is actually an abstraction layer over the Windows GDI, and therefore a linux port would need to be a complete rewrite.
.NET 6.0 will bring a new GUI framework called maui, which is intended to bring real cross-platform experience to .NET. This is hopefully the last step to make .NET really cross platform, as it was actually designed 20 years ago. You can already try it out, as prerelease versions of .NET 6.0 are ready for download (go to https://aka.ms/dotnet-download).
0 question comments
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.