dotnet / dotnet/wpf

BamlLocalizer should support .NET 5+ WPF assemblies

Open
#5,264 3 comments 1 reaction 0 assignees View on GitHub
Partner Request
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

The DevDiv build toolset for localization (involving lsbuild) fails when fed WPF assemblies that target .NET 5. The BamlLocalizer apparently runs on .NET Framework, and in loading .NET 5 assemblies it cannot find .NET 5 ref assemblies such as `PresentationFramework` since it's looking in the GAC, or is reading the ref-only assembly that .NET 5 compilations are exposed to.

The error we see, even after feeding it *all* the ref assemblies, is that the ref assemblies cannot be loaded except in the for-reflection-only context. At a minimum I suspect the LoadFrom method calls need to be replaced with LoadForReflectionOnly (or whatever it's called.)
But more generally, I wonder how much we can depend on being able to load .NET Core assemblies on .NET Framework even under reflection-only, considering that .NET Core allows things that the desktop CLR would consider illegal (e.g. default interface implementations). Maybe the full fix would be to move the task to run on .NET Core.

This is blocking our efforts as described by email.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.