News

Guidance for Porting 'Complicated' Desktop Apps to .NET Core Published

After previously publishing developer guidance for porting "simple" desktop apps to the new .NET Core platform, Microsoft has just followed up with a two-part post on a more "complicated" project.

A couple weeks ago, Olia Gavrysh, program manager, .NET, explained the company's reasoning:

Since I've been working with the community on porting desktop applications from .NET Framework to .NET Core, I've noticed that there are two camps of folks: some want a very simple and short list of instructions to get their apps ported to .NET Core while others prefer a more principled approach with more background information. Instead of writing up a "Swiss Army knife"-document, we are going to publish two blog posts, one for each camp:
  • This post is the simple case. It's focused on simple instructions and smaller applications and is the easiest way to move your app to .NET Core.
  • We will publish another post for more complicated cases. This post will focus more on non-trivial applications, such WPF application with dependencies on WCF and third-party UI packages.

That more complicated project is now out, with the WCF functionality being of special interest to many Microsoft-centric developers.

As we detailed last month, WCF projects are a sticky point with .NET Core, the company's new cross-platform, open source direction for the venerable Windows-only .NET Framework that has been relegated to maintenance mode, with all new feature development being ploughed into Core offerings.

In announcing next year's shift to a unified .NET 5, Microsoft exec Rich Lander said, " If you are a remoting or WCF developer and want to build a new application on .NET Core, we would recommend either ASP.NET Core Web APIs or gRPC (Google RPC, which provides cross platform and cross programming language contract based RPCs)." That didn't sit well with several developers, one of whom said, "I don't understand the purposeful killing of WCF. It seems sadistic. They got us to buy in and make our apps rely on it, and now they're telling us we can't use it in the future, when our apps are already deeply tied to it."

So WCF dependencies on .NET Core require some extra work, and, reflecting the extra amount of detail required, Microsoft's Mike Rousos today (June 10) tackled the complicated project in a two-part post titled "Migrating a Sample WPF App to .NET Core 3" (part one here and part two here).

He cautioned that it wasn't a best-practices example, as he purposely threw in some anti-patterns to provide realistic, thorny problems developers might run into.

He said interesting dependencies in the app include:

  • WCF communication with a backend trading service via a duplex NetTcp channel
  • UI styling and dialogs from MahApps.Metro
  • Dependency injection with Castle.Windsor (though, of course, many DI solutions -- including Microsoft.Extensions.DependencyInjection -- could be used in this scenario)
  • App settings in app.config and the registry
  • A variety of resources and resx files

"These posts don't focus on any one particular porting issue," Rousos said. "Instead, they're meant to give an overview of the steps needed to port a sample WPF app. If there are particular .NET Core migration topics you'd like a deeper look at, let us know in the comments."

These are the four major steps:

 Migration Process from .NET Framework to .NET Core
[Click on image for larger view.] Migration Process from .NET Framework to .NET Core (source: Microsoft).

To help developers following along in the posts, the project is parked here on GitHub, and a five-part series of YouTube videos averaging about 20 minutes each are available for visual learners.

About the Author

David Ramel is an editor and writer at Converge 360.

comments powered by Disqus

Featured

  • Compare New GitHub Copilot Free Plan for Visual Studio/VS Code to Paid Plans

    The free plan restricts the number of completions, chat requests and access to AI models, being suitable for occasional users and small projects.

  • Diving Deep into .NET MAUI

    Ever since someone figured out that fiddling bits results in source code, developers have sought one codebase for all types of apps on all platforms, with Microsoft's latest attempt to further that effort being .NET MAUI.

  • Copilot AI Boosts Abound in New VS Code v1.96

    Microsoft improved on its new "Copilot Edit" functionality in the latest release of Visual Studio Code, v1.96, its open-source based code editor that has become the most popular in the world according to many surveys.

  • AdaBoost Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the AdaBoost.R2 algorithm for regression problems (where the goal is to predict a single numeric value). The implementation follows the original source research paper closely, so you can use it as a guide for customization for specific scenarios.

  • Versioning and Documenting ASP.NET Core Services

    Building an API with ASP.NET Core is only half the job. If your API is going to live more than one release cycle, you're going to need to version it. If you have other people building clients for it, you're going to need to document it.

Subscribe on YouTube