13

Can I Build Desktop Apps(WPF,Windows forms) Using .Net Core?

i know Console App Build Using Both .net core and .net framework. But When i develop Console app using .net core it will runs on(Win,Mac,Linux) is it true?

5
  • It looks like you are asking two questions, one about GUI apps and one about platforms for console apps. Commented Dec 14, 2017 at 7:31
  • No you cant. If you select .NET Core in Visual Studio you can see the only available type of projects in console app / ASP.NET / Class Lib + Tests. True .NET Core is platform independent. Commented Dec 14, 2017 at 7:36
  • If you need a gui have a look at Xamarin Commented Dec 14, 2017 at 7:37
  • 3
    Microsoft upcoming .NET Core 3.0 will support WF and WPF projects. blogs.msdn.microsoft.com/dotnet/2018/05/07/… Commented May 28, 2018 at 11:57
  • In the last Microsoft Build event they announce news about .NET Core 3. "The highlight of .NET Core 3 is support for Windows desktop applications, specifically Windows Forms, Windows Presentation Framework (WPF), and UWP XAML." You can see more about it here Commented Aug 13, 2018 at 8:47

4 Answers 4

11

UPDATED for .NET 6

.NET 6 will support MAUI, WPF and Winforms for UI.

this means we have at least 3 solutions for a cross-platform UI

ElectronJs still looks like a solid way to support all main OS's (iOS, Linux and Windows)

.NET 6 - all platforms

Original Answer

.NET CORE 3 will support windows (WPF, winforms) development, only on windows, note at this time its not released yet (at the time of posting).

Mono + Gtk# should support Linux, Mac and Windows.

Windows only

either way, if you really want to write cross platform windows, consider exposing a Web Api and write windows client using electronjs

Sign up to request clarification or add additional context in comments.

5 Comments

Do they plan to add cross platform support for WPF in the future versions of . Net Core?
@Exerion i do not know, there is nothing at the moment to indicate that, I guess if the community shows demand then that could change things
@dbones Why would I want to use a cross platform client, if MS is doing it? I do not understand. It makes it sound like one can write WinForms on Windows, like Win32 forms apps, and they "just work" on Linux.
@johnny, not sure what the confusion is here, WPF/winforms will only work on Windows (these frameworks do not work on Linux/mac at this time). Electronjs is a cross platform UI framework, have a look at something like bitwarden (its on github)
Just (re)built my WinForm app using HML5 (Canvas), JavaScript, CSS (Bootstrap) and Electron and I'm amazed at how great it really is. I've ran it on Windows, Linux (Ubuntu) and Mac (Mojave). Electron works really well for solving this problem that isn't really solvable with any other framework at this time (Flutter isn't there, dotnet core still isn't there).
9

Yes, .NET Core apps are able to run on Mac and Linux as well. Depending on used OS specific APIs. Because of Xamarin, Microsoft probably will not provide a UI technology for .NET Core.

Fortunately the community creates some: You should definitely have a look into Avalonia, written by Steven Kirk: https://github.com/AvaloniaUI/Avalonia

EDIT Dec. 06th 2018:
Actually Microsoft will support WPF and WinForms upon .NET Core 3.0 on Windows. I didn't know about that back in Dec. 2017 :-)

EDIT Mar. 18th 2019
https://asp.net-hacker.rocks/2019/02/11/dotnetcore3.html

3 Comments

This answer might confuse some as it neglects to mention that WPF and WinForms are NOT available on .NET Core at present (although support is expected with the release of .NET Core 3, planned for sometime in 2019). Even then, WPF/WinForms will not be supported cross-platform even on Core for a variety of (presumably obvious) reasons.
Hi @BrianLacy, that was fact back in Dez. 2017. Actually they will support WPF and WinForms upon .NET Core 3.0 on Windows. So you are right, it will be confusing, if you don't look at the date of this answer :)
Indeed. My comment was to provide clarification for those who view this answer in the present, and not those who view it after support is added, nor for those who manage to travel back in time to when your answer was posted. :D
3

Can I Build Desktop Apps(WPF,Windows forms) Using .Net Core?

Yes, Winforms and WPF applications can be built in upcoming Dotnet Core 3.0

Check this blog article. You can also run the Portability analyser in advance.

Update April 17th 2019:

Now we can start using the DotNet Core 3.0 Preview 2 on Visual Studio 2019.

Some of the key features relevant to Desktop app -

  • C# 8

  • Default executables

  • Windows desktop applications using WPF and Windows Forms

  • MSIX Deployment for Windows Desktop

  • Windows Native Interop

See here for porting a desktop application to Dotnet Core 3.0

Comments

0

JIC, it's possible to build desktop apps using Mono/Xamarin. Here's an example of Xamarin.Forms app targeting Xamarin.Mac (macOS) and Xamarin.WPF(Windows) + Android.

https://github.com/maxim-saplin/CrossPlatformDiskTest

At the moment it seems like Xamarin.Forms is the easiest way to start building GUI apps for non-Windows platforms using XAML and C#/.NET. Besides Android/iOS, there's a variety of desktop platforms supported: macOS (via Xamarin.Mac, GTK), Windows (via WPF, UWP, GTK), Linux (via GTK).

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.