-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Conversation
The linker was trimming out IMarshal because it saw the interface was never used by managed code. This does get used by COM and the interface being present but empty breaks native code when it attempts to call an method that is missing from the interface.
It strikes me that we'd probably have discovered this if we had some simple testcases to test the functionality of StandardOleMarshal. I can see about adding those. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree a test would probably be wise
Do we need to actually fix the linker to not trim cc @sbomer |
@jkotas, yes, I'm typing up that issue now. Also I did a new pass at looking at the linker diffs to find more of these. Working on uploading those reports to azure so I can link them in the deadcode issue. |
To circle back, I reviewed all the [ComImport] interfaces and found that this appears to be the only one trimmed. We have a lot in S.R.WindowsRuntime which will get wacked if I force trimming on that assembly, but we're already opting out due to this: Lines 56 to 57 in 0b0f63d
|
Don't trim IMarshal Commit migrated from dotnet/corefx@2bb6824
The linker was trimming out IMarshal because it saw the interface was never used by managed code.
This does get used by COM and the interface being present but empty breaks native code when it attempts to call an method that is missing from the interface.
/cc @luqunl @Tanya-Solyanik