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

  • Hands On: New VS Code Insiders Build Creates Web Page from Image in Seconds

    New Vision support with GitHub Copilot in the latest Visual Studio Code Insiders build takes a user-supplied mockup image and creates a web page from it in seconds, handling all the HTML and CSS.

  • Naive Bayes Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the naive Bayes regression technique, where the goal is to predict a single numeric value. Compared to other machine learning regression techniques, naive Bayes regression is usually less accurate, but is simple, easy to implement and customize, works on both large and small datasets, is highly interpretable, and doesn't require tuning any hyperparameters.

  • VS Code Copilot Previews New GPT-4o AI Code Completion Model

    The 4o upgrade includes additional training on more than 275,000 high-quality public repositories in over 30 popular programming languages, said Microsoft-owned GitHub, which created the original "AI pair programmer" years ago.

  • Microsoft's Rust Embrace Continues with Azure SDK Beta

    "Rust's strong type system and ownership model help prevent common programming errors such as null pointer dereferencing and buffer overflows, leading to more secure and stable code."

  • Xcode IDE from Microsoft Archrival Apple Gets Copilot AI

    Just after expanding the reach of its Copilot AI coding assistant to the open-source Eclipse IDE, Microsoft showcased how it's going even further, providing details about a preview version for the Xcode IDE from archrival Apple.

Subscribe on YouTube

Upcoming Training Events