-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
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.
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: