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 for Converge360.

comments powered by Disqus

Featured

  • AI for GitHub Collaboration? Maybe Not So Much

    No doubt GitHub Copilot has been a boon for developers, but AI might not be the best tool for collaboration, according to developers weighing in on a recent social media post from the GitHub team.

  • Visual Studio 2022 Getting VS Code 'Command Palette' Equivalent

    As any Visual Studio Code user knows, the editor's command palette is a powerful tool for getting things done quickly, without having to navigate through menus and dialogs. Now, we learn how an equivalent is coming for Microsoft's flagship Visual Studio IDE, invoked by the same familiar Ctrl+Shift+P keyboard shortcut.

  • .NET 9 Preview 3: 'I've Been Waiting 9 Years for This API!'

    Microsoft's third preview of .NET 9 sees a lot of minor tweaks and fixes with no earth-shaking new functionality, but little things can be important to individual developers.

  • Data Anomaly Detection Using a Neural Autoencoder with C#

    Dr. James McCaffrey of Microsoft Research tackles the process of examining a set of source data to find data items that are different in some way from the majority of the source items.

  • What's New for Python, Java in Visual Studio Code

    Microsoft announced March 2024 updates to its Python and Java extensions for Visual Studio Code, the open source-based, cross-platform code editor that has repeatedly been named the No. 1 tool in major development surveys.

Subscribe on YouTube