You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
unzip and build project via command line with msbuild -p:platform=x64 -bl
Observe failure about trying to resolve System.Xaml
If we look at the binlog, failure occurs under MarkupCompilePass1 target, specifically in CompileXaml task. For that task, if we look at Parameters > ReferenceAssemblies we can see WindowsFormsIntegration.dll
If we search ReferencePath (this is what the ReferenceAssemblies parameter is in the targets file), we can see WindowsFormsIntegration.dll first gets added in ResolveAssemblyReferences target, specifically ResolveAssemblyReference task
In .NET 8 binlog which is included in zip observe WindowsFormsIntegration.dll is not included in ReferencePath
More info: This was originally reported via dotnet/maui#25883 but scenario can be simplified which is what the repro project demonstrates
The text was updated successfully, but these errors were encountered:
lonitra
changed the title
Microsoft.WindowsDesktop.App.WindowsForms Tries to Pull in System.Xaml
FrameworkReference Microsoft.WindowsDesktop.App.WindowsForms Includes WindowsFormsIntegration.dll
Nov 21, 2024
lonitra
changed the title
FrameworkReference Microsoft.WindowsDesktop.App.WindowsForms Includes WindowsFormsIntegration.dll
FrameworkReference Microsoft.WindowsDesktop.App.WindowsForms Incorrectly Includes WindowsFormsIntegration.dll
Nov 21, 2024
In .NET 9 we are experiencing issues where when adding
<FrameworkReference Include="Microsoft.WindowsDesktop.App.WindowsForms" />
in a winUI project and building, it tries to resolve System.Xaml even though WinForms does not reference Xaml. This is occurring because we had changedWindowsFormsIntegration.dll
to have profile with WPF and WindowsForms causingResolveAssemblyReferences
target to include WindowsFormsIntegration.dll in references thus pulling this .dll in even though it is only intended when no profile is specified i.e.UseWindowsForms
andUseWPF
is true as indicated in https://github.com/dotnet/wpf/blob/bbfc24fd13804a191e20064acd599b0a359092df/packaging/Microsoft.NET.Sdk.WindowsDesktop/targets/Microsoft.NET.Sdk.WindowsDesktop.props#L45-L46. In .NET 8 there was no profile attribute for this dll.We had made this update as part of #4227 to support runtime pack respecting profiles when publish self contained winforms/wpf app (dotnet/sdk#37088)
Repro project: App11.zip
Repro steps:
msbuild -p:platform=x64 -bl
MarkupCompilePass1
target, specifically inCompileXaml
task. For that task, if we look at Parameters > ReferenceAssemblies we can see WindowsFormsIntegration.dllReferencePath
(this is what the ReferenceAssemblies parameter is in the targets file), we can see WindowsFormsIntegration.dll first gets added inResolveAssemblyReferences
target, specificallyResolveAssemblyReference
taskReferencePath
More info: This was originally reported via dotnet/maui#25883 but scenario can be simplified which is what the repro project demonstrates
The text was updated successfully, but these errors were encountered: