Remove /clr:pure from WPF C++/CLI projects#11575
Remove /clr:pure from WPF C++/CLI projects#11575vinnarayana-msft wants to merge 1 commit intodotnet:mainfrom
Conversation
Migrate DirectWriteForwarder and System.Printing from /clr:pure to /clr:netcore (IJW mixed mode) in preparation for MSVC 14.51 which removes /clr:pure + /clr:netcore support. Changes: - CLRSupport and CompileAsManaged changed from pure to NetCore - Removed pure to NetCore conversion logic in Wpf.Cpp.props - Removed ijwhost.dll packaging exclusion (required for mixed-mode) - Added _M_ARM64 to architecture check in intsafe_private_copy.h Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Updates WPF’s C++/CLI build configuration to remove reliance on deprecated /clr:pure in favor of standard /clr:netcore (IJW mixed mode), aligning with upcoming MSVC toolset behavior and unblocking future builds.
Changes:
- Switched
CLRSupportandCompileAsManagedfrompuretoNetCoreforDirectWriteForwarderandSystem.Printing. - Simplified
Wpf.Cpp.propsby removing thepure→NetCoreremapping logic and updatingManagedCxxconditions. - Fixed an ARM64 compilation break by extending architecture detection in
intsafe_private_copy.h.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/Microsoft.DotNet.Wpf/src/System.Printing/System.Printing.vcxproj | Moves the project to /clr:netcore and allows ijwhost.dll to be packaged by removing the exclusion. |
| src/Microsoft.DotNet.Wpf/src/DirectWriteForwarder/DirectWriteForwarder.vcxproj | Moves the project to /clr:netcore and allows ijwhost.dll to be packaged by removing the exclusion. |
| src/Microsoft.DotNet.Wpf/src/DirectWriteForwarder/CPP/TrueTypeSubsetter/TtfDelta/intsafe_private_copy.h | Adds _M_ARM64 handling to prevent ARM64 build errors. |
| eng/WpfArcadeSdk/tools/Wpf.Cpp.props | Updates shared build logic to recognize CLRSupport=NetCore and removes the old pure remap. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Enable IDE support for C++/CLI .NET Core builds | ||
| --> | ||
| <PropertyGroup> | ||
| <CLRSupport Condition="'$(CLRSupport)' == 'pure'">NetCore</CLRSupport> | ||
|
|
||
| </PropertyGroup> |
|
@vinnarayana-msft please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement ( “Agreement” ) is agreed to by the party signing below ( “You” ), 1. Definitions. “Code” means the computer software code, whether in human-readable or machine-executable form, “Project” means any of the projects owned or managed by .NET Foundation and offered under a license “Submit” is the act of uploading, submitting, transmitting, or distributing code or other content to any “Submission” means the Code and any other copyrightable material Submitted by You, including any 2. Your Submission. You must agree to the terms of this Agreement before making a Submission to any 3. Originality of Work. You represent that each of Your Submissions is entirely Your 4. Your Employer. References to “employer” in this Agreement include Your employer or anyone else 5. Licenses. a. Copyright License. You grant .NET Foundation, and those who receive the Submission directly b. Patent License. You grant .NET Foundation, and those who receive the Submission directly or c. Other Rights Reserved. Each party reserves all rights not expressly granted in this Agreement. 6. Representations and Warranties. You represent that You are legally entitled to grant the above 7. Notice to .NET Foundation. You agree to notify .NET Foundation in writing of any facts or 8. Information about Submissions. You agree that contributions to Projects and information about 9. Governing Law/Jurisdiction. This Agreement is governed by the laws of the State of Washington, and 10. Entire Agreement/Assignment. This Agreement is the entire agreement between the parties, and .NET Foundation dedicates this Contribution License Agreement to the public domain according to the Creative Commons CC0 1. |
|
Can we have some link/reference to the deprecation of the combination? |
Agent-Logs-Url: https://github.com/dotnet/dotnet/sessions/85dfa847-a6bb-4471-863f-64e56545c584 Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
Description
MSVC 14.51 (VS 18.3) is removing support for
/clr:purewhen used with/clr:netcore. WPF is the only known consumer of/clr:pure. This PR migrates the two affected C++/CLI projects (DirectWriteForwarder.vcxprojandSystem.Printing.vcxproj) from/clr:pureto standard/clr:netcore(IJW mixed mode).Changes:
CLRSupportandCompileAsManagedfrompuretoNetCorein both vcxproj filesWpf.Cpp.propsto remove thepuretoNetCoreconversion logic inManagedCxxconditionsijwhost.dllfrom packaging exclusions in both vcxproj files — mixed-mode assemblies require this .NET runtime bootstrap shim to load correctlyintsafe_private_copy.hwhere_M_ARM64was missing from an architecture detection#ifcondition (previously masked by_M_CEE_PURE)Customer Impact
Without this fix, WPF will fail to build with MSVC 14.51+ (VS 18.3) since
/clr:pure+/clr:netcorewill no longer be a valid combination. This is a build-time breaking change from the MSVC toolset.Regression
No. This is a proactive change to address an upcoming MSVC toolset deprecation. No existing behavior is regressed — the output DLLs function identically at runtime.
Testing
Risk
Low-Medium. The change is minimal (4 files) and surgical — it only affects the two C++/CLI projects in WPF. The runtime behavior of the DLLs is functionally equivalent; the difference is the compilation mode (pure MSIL → IJW mixed mode). The primary risk is potential performance impact from losing ahead-of-time MSIL compilation.
Microsoft Reviewers: Open in CodeFlow