Remove /clr:pure from WPF C++/CLI projects#11575
Remove /clr:pure from WPF C++/CLI projects#11575vinnarayana-msft wants to merge 4 commits 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> |
|
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>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Please refer to this page /clr:pure is deprecated. The option is removed in Visual Studio 2017 and later. We recommend that you port code that must be pure MSIL to C#. The driver also gives a deprecation warning if /clr:pure is used: cl : Command line warning D9035 : option 'clr:pure' has been deprecated and will be removed in a future release |
@dotnet-policy-service agree company="Microsoft" |
Address PR review nit: remove CLRSupport=='pure' from DllRenameClause condition since no project sets CLRSupport to 'pure' anymore. Update comment to reference /clr:netcore instead of /clr:pure. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
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