From 89a7406f5ccdbce1568d018c849a61612181b8d8 Mon Sep 17 00:00:00 2001 From: "Milko Venkov (INFRAGISTICS INC)" Date: Tue, 30 Jun 2026 11:22:12 +0300 Subject: [PATCH 1/2] Filter re-resolved analyzers from the WPF temporary project GenerateTemporaryTargetAssembly builds a temporary *_wpftmp project to resolve local types referenced from XAML. That temporary project re-runs analyzer resolution and re-adds package analyzers the parent project had intentionally removed, without honoring the packages' removal targets. In the Visual Studio in-process build this may reintroduces unnecessary analyzers and to fail. Tag the analyzers flowed from the parent project with pfTempProjectAnalyzers metadata and set _WpfTempProjectIncludesPackageReferences on the temporary project. A new FilterTemporaryAssemblyAnalyzers target then removes any analyzer lacking that marker, restoring the authoritative analyzer set the parent project already resolved. Fixes #9660 --- .../Microsoft.WinFX.targets | 21 +++++++++++++++++++ .../GenerateTemporaryTargetAssembly.cs | 14 +++++++++++-- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft.WinFX.targets b/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft.WinFX.targets index d3c9ba6d6eb..144f42c0100 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft.WinFX.targets +++ b/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft.WinFX.targets @@ -503,6 +503,27 @@ + + + + + + +