Skip to content

Retarget WPF to .NET 12 - #12097

Merged
subhajitm merged 2 commits into
mainfrom
dev/subhajitm/wpf-net12-retarget
Nov 6, 2026
Merged

subhajitm merged 2 commits into
mainfrom
dev/subhajitm/wpf-net12-retarget

Conversation

@subhajitm

@subhajitm subhajitm commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #

Main PR

Description

Retargets WPF to .NET 12 as part of the .NET 12 TFM update.

  • Directory.Build.props: TargetFramework net11.0 → net12.0, TargetFrameworkVersion 11.0 → 12.0.
  • Documentation/developer-guide.md: sample uses net12.0-windows.
  • Project template changes will be in a follow-up PR.

Microsoft.WinFX.targets still loads PresentationBuildTasks from tools\net11.0, because the task is built for $(BundledNETCoreAppTargetFramework), which is still net11.0 with the current SDK. It should move when the SDK bundles net12.0.

Customer Impact

Without this change, WPF continues to build against net11.0 while the rest of the .NET 12 stack has moved to net12.0.

Regression

No.

Testing

Local, Debug x64:

  • .\eng\scripts\cibuild.cmd -configuration Debug /p:Platform=x64 /p:Coverage=false: passed, 0 warnings, 0 errors.
  • .\eng\scripts\ciunittest.cmd -configuration Debug /p:Platform=x64 /p:Coverage=false: all 6 unit-test projects passed on .NETCoreApp,Version=v12.0, 0 failures.

Risk

Low. Only the root target framework changes; build and unit tests pass.

Microsoft Reviewers: Open in CodeFlow

Update the repository target framework to net12.0, add net12.0 as the default framework choice in project templates, and update the developer guide.

Co-authored-by: Copilot <[email protected]>
@dotnet-policy-service dotnet-policy-service Bot added PR metadata: Label to tag PRs, to facilitate with triage draft labels Nov 3, 2026
@subhajitm
subhajitm requested a balanced review from Copilot November 4, 2026 11:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are recorded for the WPF and project-template retargeting to .NET 12.

No open issues 🎉

What changed in this PR

Retargets WPF and its project templates to .NET 12, aligning the product with the broader .NET 12 framework update.

Changes:

  • Updates the root target framework and framework version to .NET 12.
  • Adds and defaults to net12.0 in all eight C#/VB templates, including English labels and C# feature/content conditions.
  • Updates the developer-guide sample to net12.0-windows.
File Description
packaging/​Microsoft.Dotnet.Wpf.ProjectTemplates/​content/​WpfUserControlLibrary-VisualBasic/​.template.config/​template.json Adds and defaults to .NET 12.
packaging/​Microsoft.Dotnet.Wpf.ProjectTemplates/​content/​WpfUserControlLibrary-VisualBasic/​.template.config/​localize/​templatestrings.en.json Adds English .NET 12 labels.
packaging/​Microsoft.Dotnet.Wpf.ProjectTemplates/​content/​WpfUserControlLibrary-CSharp/​.template.config/​template.json Defaults to .NET 12 and extends feature/content conditions.
packaging/​Microsoft.Dotnet.Wpf.ProjectTemplates/​content/​WpfUserControlLibrary-CSharp/​.template.config/​localize/​templatestrings.en.json Adds English .NET 12 labels.
packaging/​Microsoft.Dotnet.Wpf.ProjectTemplates/​content/​WpfCustomControlLibrary-VisualBasic/​.template.config/​template.json Adds and defaults to .NET 12.
packaging/​Microsoft.Dotnet.Wpf.ProjectTemplates/​content/​WpfCustomControlLibrary-VisualBasic/​.template.config/​localize/​templatestrings.en.json Adds English .NET 12 labels.
packaging/​Microsoft.Dotnet.Wpf.ProjectTemplates/​content/​WpfCustomControlLibrary-CSharp/​.template.config/​template.json Defaults to .NET 12 and extends feature/content conditions.
packaging/​Microsoft.Dotnet.Wpf.ProjectTemplates/​content/​WpfCustomControlLibrary-CSharp/​.template.config/​localize/​templatestrings.en.json Adds English .NET 12 labels.
packaging/​Microsoft.Dotnet.Wpf.ProjectTemplates/​content/​WpfClassLibrary-VisualBasic/​.template.config/​template.json Adds and defaults to .NET 12.
packaging/​Microsoft.Dotnet.Wpf.ProjectTemplates/​content/​WpfClassLibrary-VisualBasic/​.template.config/​localize/​templatestrings.en.json Adds English .NET 12 labels.
packaging/​Microsoft.Dotnet.Wpf.ProjectTemplates/​content/​WpfClassLibrary-CSharp/​.template.config/​template.json Defaults to .NET 12 and extends feature/content conditions.
packaging/​Microsoft.Dotnet.Wpf.ProjectTemplates/​content/​WpfClassLibrary-CSharp/​.template.config/​localize/​templatestrings.en.json Adds English .NET 12 labels.
packaging/​Microsoft.Dotnet.Wpf.ProjectTemplates/​content/​WpfApplication-VisualBasic/​.template.config/​template.json Adds and defaults to .NET 12.
packaging/​Microsoft.Dotnet.Wpf.ProjectTemplates/​content/​WpfApplication-VisualBasic/​.template.config/​localize/​templatestrings.en.json Adds English .NET 12 labels.
packaging/​Microsoft.Dotnet.Wpf.ProjectTemplates/​content/​WpfApplication-CSharp/​.template.config/​template.json Defaults to .NET 12 and extends feature/content conditions.
packaging/​Microsoft.Dotnet.Wpf.ProjectTemplates/​content/​WpfApplication-CSharp/​.template.config/​localize/​templatestrings.en.json Adds English .NET 12 labels.
Documentation/​developer-guide.md Retargets the sample to net12.0-windows.
Directory.Build.props Sets the root framework to net12.0 and version to 12.0.

Review effort: Balanced

Keep templates on net11.0, matching dotnet/winforms; template updates will follow separately.

Co-authored-by: Copilot <[email protected]>
@subhajitm
subhajitm requested a review from akoeplinger November 4, 2026 12:32
@subhajitm
subhajitm marked this pull request as ready for review November 4, 2026 12:32
@subhajitm
subhajitm requested a review from a team November 4, 2026 12:32
@subhajitm
subhajitm requested a review from a team as a code owner November 4, 2026 12:32
@subhajitm
subhajitm merged commit 49ae5cd into main Nov 6, 2026
7 of 8 checks passed
@subhajitm
subhajitm deleted the dev/subhajitm/wpf-net12-retarget branch November 6, 2026 09:19
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR metadata: Label to tag PRs, to facilitate with triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants