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
{{ message }}
Repository navigation
[browser][CoreCLR][trimmed R2R] Reflection metadata tests lose pseudo-attribute and forwarder data #134263
The failures reproduced in PR #133656, Azure DevOps build 1603190, Helix job 3158c862-61f5-4cf9-bb24-6ecdf2cfe895, work items WasmTestOnChrome-CLR-ST-Batch-10 and Batch-13.
Expected behavior
MetadataLoadContext preserves the expected MarshalAsAttribute pseudo-attribute fields, and GetForwardedTypes reports the expected loader exception behavior.
Unknown. Broad trimmed ReadyToRun library coverage is newly enabled. Related historical Mono/EAT reflection trimming issue: #50715, but these failures are different tests and runtime configuration.
Known Workarounds
Keep System.Reflection.MetadataLoadContext.Tests.dll interpreted and temporarily exclude only AssemblyGetForwardedTypesLoadFailure under aggressively trimmed browser tests. Product reflection assemblies remain ReadyToRun compiled.
MetadataLoadContext MarshalAs cases F4/F11/F12: a Cecil bug. When ILLink rewrites the test assembly, Cecil drops the IidParameterIndex and SafeArrayUserDefinedSubType bytes from the FieldMarshal blobs (confirmed byte-for-byte). Tracked in ILLink/Cecil drops MarshalAs IidParameterIndex and SafeArrayUserDefinedSubType when rewriting assemblies #134761. The existing TrimMode=copy workaround for System.Reflection.MetadataLoadContext.Tests.dll stays until that's fixed.
Note
This comment was generated with GitHub Copilot assistance.
Activity
dotnet-policy-service commentedon Sep 19, 2026
Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara
See info in area-owners.md if you want to be subscribed.
dotnet-policy-service commentedon Sep 19, 2026
Tagging subscribers to this area: @steveisok, @dotnet/area-system-reflection
See info in area-owners.md if you want to be subscribed.
lewing commentedon Sep 27, 2026
Root causes, both reproduced locally on trimmed browser-wasm CoreCLR:
AssemblyGetForwardedTypesLoadFailure: ILLink dropsUnloadableAssembly.dll, because a type forwarder is its only reference. Resolving the forwarded type then fails with a missing-file error instead ofBadImageFormatException. Fixed in [browser][CoreCLR] Root UnloadableAssembly so trimmed builds keep it for AssemblyGetForwardedTypesLoadFailure #134759.MarshalAscases F4/F11/F12: a Cecil bug. When ILLink rewrites the test assembly, Cecil drops theIidParameterIndexandSafeArrayUserDefinedSubTypebytes from the FieldMarshal blobs (confirmed byte-for-byte). Tracked in ILLink/Cecil drops MarshalAs IidParameterIndex and SafeArrayUserDefinedSubType when rewriting assemblies #134761. The existingTrimMode=copyworkaround forSystem.Reflection.MetadataLoadContext.Tests.dllstays until that's fixed.Note
This comment was generated with GitHub Copilot assistance.
[browser][CoreCLR] Root UnloadableAssembly so trimmed builds keep it …