Warn about some COM usage - #1382
Conversation
COM represents a problem for trimming because the usage of the interfaces are not visible to the linker. The problem is twofold: * The IDispatch interface that COM objects can be cast to is basically reflection. * IUnknown.QueryInterface lets the native side get to any COM visible interface on the managed side. COM visible is pretty much everything because it's the default. We can't root those because it would make trimming not very effective.
vitek-karas
left a comment
There was a problem hiding this comment.
What's the impact on framework? How many such warnings show up when we run this over CoreLib and friends?
For a trimmed Console app there's no warnings. No warnings for Blazor either. About a dozen warnings for a WinForms app. There are some warnings within the framework, e.g. System.Drawing ( |
|
We should wait merging this until your big warning overhaul goes through. |
|
Actually I would rather do it the other way round - merge this when possible - I have some other reshuffling of warnings to do in the overhaul PR. |
Works for me if it's not causing extra trouble for you, thanks! I'll merge once I see the CI green. |
COM represents a problem for trimming because the usage of the interfaces are not visible to the linker. The problem is twofold: * The IDispatch interface that COM objects can be cast to is basically reflection. * IUnknown.QueryInterface lets the native side get to any COM visible interface on the managed side. COM visible is pretty much everything because it's the default. We can't root those because it would make trimming not very effective. Commit migrated from dotnet/linker@968d356
COM represents a problem for trimming because the usage of the interfaces are not visible to the linker.
The problem is twofold: