If you haven't had a chance to explore the new capabilities of .NET Core 3, read along with an expert in the framework to discover what it brings to the table.
Maybe you already heard or read about the fact that Microsoft brought WinForms and WPF to .NET Core 3.0. Maybe you already saw the presentations on the Connect conference, or any other conference or recording when Scott Hanselman shows how to run a pretty old WPF application on .NET Core. I saw a demo where he ran BabySmash on .NET Core.
BTW: My oldest son really loved that BabySmash when he was a baby.
I was really wondering about this step, even because I wrote an article for a German .NET magazine some months before where I mentioned that Microsoft won’t build a UI Stack for .NET Core. There were some other UI stacks built by the community. The most popular is Avalonia.
But this step makes sense anyway. Since the .NET Standards move the API of .NET Core more to the same level of the .NET framework, making the APIs almost equal was simply a question of time. WPF and WinForms are based on .NET Libraries, so it should run on .NET Core.
Nope! Since WinForms and WPF uses Windows only technology in the background, it cannot run on Linux or Mac. It is really dependent on Windows. The sense of running it on .NET Core is performance and to be independent of any framework. .NET Core is optimized for performance so you can run super fast web applications in the cloud. .NET Core is also independent of the installed framework on the machine. Just deploy the runtime together with your application.
You are now able to run fast and self-contained Windows desktop applications. That’s awesome, isn’t it!?
Every time I install a new version of the .NET Core runtime I try
dotnet new and I was positively shocked about what I saw this time:
You are now able to create a Windows Form or a WPF application using the .NET CLI. This is cool. And I for sure needed to try it out:
dotnet new -n WpfTest -o WpfTest dotnet new -n WpfTest -o WpfTest
And yes, it is working as you can see here in Visual Studio Code:
And this is the WinForms project in VS Code
dotnet run on the WPF project:
And again on the WinForms GUI:
Visual Studio Code isn’t the right editor for this kind of project. If you know XAML pretty well, it will work, but WinForms definitely won’t work well. You need to write the designer code manually and there isn’t any designer support yet. Maybe there will be some in the future, but I’m not sure.
The best choice to work with WinForms and WPF on .NET Core is Visual Studio 2017 or newer.
I don’t think I will now start to write desktop apps on .NET Core 3, because I’m a web guy. But it is a really nice option to build apps like this on .NET Core.
BTW: Even EF 6 will work in .NET Core 3, which means you also don’t need to rewrite the database access part of your desktop application.
As I wrote, you can now use this super fast framework and the option to create self-contained apps. I would suggest you try it out and play around with it. Do you have an older desktop application based on WPF or WinForms? I would be curious about whether you can run it on .NET Core 3. Tell me how easy it was to get it running on .NET Core 3.
Originally published by Juergen Gutsch at https://dzone.com
ＬＩＫＥ | ＣＯＭＭＥＮＴ | ＳＨＡＲＥ | ＳＵＢＳＣＲＩＢＥ In this video, I will demo how to create Encrypt Password in Login Form with ASP.NET MVC and Entity Framework. Subscribe &...
ＬＩＫＥ | ＣＯＭＭＥＮＴ | ＳＨＡＲＥ | ＳＵＢＳＣＲＩＢＥ Today, in this tutorial you will see the process of adding an ASP.NET Identity to the ASP.NET Web Application developed in...
ＬＩＫＥ | ＣＯＭＭＥＮＴ | ＳＨＡＲＥ | ＳＵＢＳＣＲＩＢＥ In this video, i will show you How to retrieve and display all the registered application users in asp.net core using the ...
ＬＩＫＥ | ＣＯＭＭＥＮＴ | ＳＨＡＲＥ | ＳＵＢＳＣＲＩＢＥ In this tutorials, I will show you how to extend IdentityUser in asp.net core.. Subscribe & Stay Connected! Thank You! ♥ #...
ＬＩＫＥ | ＣＯＭＭＥＮＴ | ＳＨＡＲＥ | ＳＵＢＳＣＲＩＢＥ Today I will show you how to clear session data after logout from web application using asp.net core... Source code link :...