I noticed some IL2026 messages are wrong, for types in the XAML compiler generated metadata table:
"[...]\x64\net9.0-windows10.0.26100.0\XamlTypeInfo.g.cs(632,75): warning IL2026: Using member '[...]_XamlTypeInfo.XamlTypeInfoProvider.InitTypeTables()' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code.This behavior is not trim-safe."
That message can't be right, as InitTypeTables has no trim annotations on it. In fact, this is what you see:
That is, the diagnostic location seems right. Microsoft.Xaml.Interactions.Core.EventTriggerBehavior has [RequiresUnreferencedCode], and it's used as a type argument here. But somehow the type name in the message is the name of the parent InitTypeTables() method where this assignment is.
Reproduction Steps
Same as #109270. Can't share repro steps here (since the code is not open source).
I can however share:
Description
I noticed some IL2026 messages are wrong, for types in the XAML compiler generated metadata table:
That message can't be right, as
InitTypeTables
has no trim annotations on it. In fact, this is what you see:That is, the diagnostic location seems right.
Microsoft.Xaml.Interactions.Core.EventTriggerBehavior
has[RequiresUnreferencedCode]
, and it's used as a type argument here. But somehow the type name in the message is the name of the parentInitTypeTables()
method where this assignment is.Reproduction Steps
Same as #109270. Can't share repro steps here (since the code is not open source). I can however share:
Expected behavior
The message should correctly indicate the problematic type.
Actual behavior
See screenshot above.