migrating-wpf-to-dotnet

Migrates WPF applications from .NET Framework to modern .NET with SDK-style project conversion.

Updated Nov 22, 2023
One-click install
npx skills add https://github.com/parksanghoon-sys/TestCode --skill migrating-wpf-to-dotnet-parksanghoon-sys
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: migrating-wpf-to-dotnet
Source: https://github.com/parksanghoon-sys/TestCode/tree/main/src/Modbus/wpf-dev-pack/.agents/skills/migrating-wpf-to-dotnet
Command: npx skills add https://github.com/parksanghoon-sys/TestCode --skill migrating-wpf-to-dotnet-parksanghoon-sys

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Upgrading legacy WPF applications from .NET Framework to .NET 6+ involves project file conversion, NuGet reference migration, breaking API changes, and deployment reconfiguration, all of which are error-prone when done manually. ## Core Features & Use Cases - Project File Conversion: Converts legacy .csproj files to SDK-style format with UseWPF, Nullable, and ImplicitUsings settings, using try-convert or manual steps. - Breaking Change Guidance: Maps removed APIs like BinaryFormatter, Remoting, and CAS to modern alternatives, and covers WCF client and Windows Forms interop setup. - Dual Targeting & Deployment: Supports multi-targeting net48 and net10.0-windows for gradual migration, plus self-contained, single-file, and ReadyToRun publishing. - Use Case: You maintain a .NET Framework 4.8 WPF app and need to move it to .NET 10 while keeping the build green and preserving Windows Forms interop. ## Quick Start Migrate my WPF application from .NET Framework 4.8 to .NET 10 and fix any compatibility issues that come up.

Frequently Asked Questions about migrating-wpf-to-dotnet

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate a WPF app from .NET Framework to .NET 8?▼

Convert the project file to SDK-style format with TargetFramework set to net8.0-windows and UseWPF enabled, migrate packages.config to PackageReference, then build and fix errors. The try-convert tool can automate the initial project file conversion.

How to convert packages.config to PackageReference in WPF projects?▼

Replace the packages.config file with PackageReference entries inside an ItemGroup in the SDK-style project file, specifying each package name and version. SDK-style projects restore NuGet packages directly from these references.

Does WPF on .NET 8 support Windows Forms interop?▼

Yes, WPF on modern .NET supports Windows Forms interop by setting both UseWPF and UseWindowsForms to true in the project file. This preserves existing Forms integration code during migration.

Can I use WCF after migrating WPF to .NET 8?▼

WCF client scenarios are supported via the System.ServiceModel.Http and System.ServiceModel.Primitives NuGet packages. WCF server-side code is not supported and should be migrated to CoreWCF or gRPC.

What APIs were removed when migrating from .NET Framework to .NET?▼

BinaryFormatter was removed for security reasons and should be replaced with System.Text.Json. AppDomain.CreateDomain, Remoting, and Code Access Security are also unsupported, with gRPC or SignalR suggested as Remoting alternatives.

How to gradually migrate a large WPF app without a big-bang rewrite?▼

Use multi-targeting with TargetFrameworks set to both net48 and net10.0-windows, combined with conditional compilation directives for framework-specific code. This lets both versions build side by side during the transition.