I just read that there is possibility to develop Windows Forms using .NET Core 3.0. Unfortunetly designer is still under development and not available. I also read that even if Windows Forms can be done using Core 3.0 that doesn't mean that it can run on either MAC or OS (same with WPF). My question is what is then the sense of it if it cannot be deployed on diffrent systems besides Windows? What type of desktop application can i really develop to be able to deploy on various systems rather than Windows forms?
That's because Microsoft seems to plan to retire the original .net and just focus on developing .netcore. My suggestion is to build application using web technologies. This way you have the best of both worlds either build web application or develop cross platform apps using something like electron.js
there are so many great apps built with electron like Vs Code or Github
There are many use cases for Windows-only desktop applications, particularly in the corporate world where applications are for internal use.
If you need a cross platform application I would suggest either a web application, or you could consider Electron.
AvaloniaUI (A cross platform XAML Framework for .NET Framework, .NET Core and Mono) would be a perfect choice if you are familiar with WPF.
There are many other frameworks to develop cross-platform desktop apps. You can checkout my github repo electron-alternatives for more cross-platform desktop development options.
Related
My project is based on PHP tool. I need to fetch the data from that tool using ASP.NET C# to convert this to desktop application. Will ASP.NET Core app support desktop applications?
Or suggest any technology which will support desktop application.
You can implement a Windows Presentation Foundation (WPF) application using .Net Core, but for now, you may only use Visual Studio as an IDE (Rides does not support it).
See this for more information:
https://learn.microsoft.com/en-us/visualstudio/get-started/csharp/tutorial-wpf?view=vs-2022
I personally prefer to create desktop apps using Electron, which is a cross-platform JavaScript-based framework.
See Electron's documentations here: https://www.electronjs.org/
For a project, I build a WinForms application using .NET 7.0. I noticed it must run on Linux so I made some research and found that it's possible to run .NET code with mono but it's not applicable to WinForms. Is there a solution to convert my project without having to make the design of the forms from scratch (like would be the case with mono development)?
Thanks.
What I tried: Installing mono and running my code. It says me that no CLI image was found.
No cross-platform desktop GUI exists in .NET out of the box.
To overcome this issue Microsoft created MAUI although it was announced Linux devices won't get official support.
Your best bet would be to migrate to Avalonia or UNO, both are great open-source, free and feature-rich frameworks built on top of .NET which works on any operating system, including Ubuntu, macOS and Windows.
Both frameworks use XAML dialect which should feel familiar for developers coming from WPF, UWP, or Xamarin Forms.
UNO can be developed using C# markup instead XAML
No XAML needed if you don’t want it – Enjoy a Flutter-like
UI development experience with C# and .NET Hot Reload
by using C# for Markup
Only .NET 7 console app runs (through .NET 7 runtime) on Linux, no WinForms, no WPF.
If you need a .NET desktop app running on Linux, and you are targeting GNOME desktop environment, you could give a try to gtk# based on mono.
I have Windows version of .NET Framework desktop application. Now I want to make version available for MacOS as well.
Is there any solution available using C#?
Will .NET Core work for both Windows and MacOs?
I have already build application using WinForms C#. I have created exe for window.. Similarly I want to run application on MacOS as well
You can try Mono then. It has (a rather limited) WinForms support. But if you never tested it on any other platforms yet, then be prepared for some issues. Among others:
You will not able to use any WinAPI directly (ie. extern methods to Win32 dlls)
You might expect some behavioral differences. Some of them affect only particular distributions.
Many of these can be handled by special handlings in you code, though. But it means you will need some IsWindowsdistinction here and there, just like in this project of mine.
And do not forget to install libgdiplus, which makes possible to use System.Drawing on non-Windows platforms, as WinForms is built on GDI+.
(.NET Core Version 3.0.103 (Commit: b7ef045669), Platform/OS: ubuntu linux 18.04-x64, Winforms branch version (date): Thu Mar 26 07:37:13 2020 -0700, VSCode 1.43.2)
I cloned current version of Winforms from Github, tried to use appropriate installation script (build.sh) but finally got only error message (I think it's a bug).
Possibly someone was more succefull?
(Even though Winforms Designer doesn't still work in VSCode on Linux as I got from documentation there should be possibility to create Windows Form Application templates from console, port existing application from .NET Framework to .NET Core and so on).
So can anyone share your experience about this?
Winforms is currently a Windows-only technology in the .NET Core runtime. I haven't seen an instance of someone circumvening this limitation.
.NET Core (and in the future .NET 5 that is built on top of .NET Core) will be the future of .NET. We are committed to support .NET Framework for years to come, however it will not be receiving any new features, those will only be added to .NET Core (and eventually .NET 5). To improve Windows desktop stacks and enable .NET desktop developers to benefit from all the updates of the future, we brought Windows Forms and WPF to .NET Core. They will still remain Windows-only technologies because there are tightly coupled dependencies to Windows APIs. But .NET Core, besides being cross-platform, has many other features that can enhance desktop applications.
The Mono Project supports Winforms, which can be run on linux, however I'm unaware of how to develop Winforms via Mono on vscode.
I'd like to develop a cross platform desktop app by using .net Core. The app needs to be executed on linux, mac os, and windows. For that purpose, should i create a console app and put below lines in settings xml?
<PropertyGroup>
<RuntimeIdentifiers>win10-x64;osx.10.12-x64;debian.8-x64</RuntimeIdentifiers>
</PropertyGroup>
Will it be sufficient? If so, should i write all platforms and separate by comma e.g.
win7-x32;win10-x64;...
If it is not the answer, how can i generate cross platform desktop app with .net Core?
As the other answer alludes to, .NET Core itself is cross-platform, but it doesn't offer any GUI solution. You can run console/terminal applications, as well as web applications, but not desktop applications.
As of right now, there is no official Microsoft tech that solves a multi-platform GUI. The two that I know of are Avalonia and Eto.Forms. Both have their pros and cons, and both are kinda buggy. Not in the sense that it's unusable, but in the sense that it's evolving tech, don't expect them to blow your mind right off the bat.
Guides to get you started :
Avalonia - https://docs.avaloniaui.net/
Eto.Forms - https://dotnetcoretutorials.com/2018/03/19/cross-platform-winforms-kinda/
1) Console apps in .NET core are already cross-platform.
2) For those working with a GUI, .NET core finally has a cross-platform GUI option officially supported by Microsoft called .NET MAUI
This builds on the same APIs as Xamarian Forms.
Official .NET MAUI Github Repo
If I understand your question correctly, it could be devided into two questions.
1) Howto create a cross platform .net core app
2) Howto create a cross platform .net core UI app
To answer the second (2) question: It's not possible to create cross platform apps using only .net core and microsoft libraries. What you need is a cross platform UI library with binding for all of your your target platforms. The first search result I get is Avalonia https://github.com/AvaloniaUI/Avalonia
I doubt it will be an easy task to get it working as all the alternatives seems to be experimental and/or beta. But you can certainly prove me wrong.
Good luck!
You can try electron.js instead . At present its quite difficult to build a cross platform desktop application only with .NET Core
You have many solutions for making a cross platform application with .NET Core:
Electron.NET
Avalonia
...
If you want detailed information about how to do that you should check a dedicated book who provide project samples for .NET Core 3 Here . With that you will find the most adapted UI for your app.