Skip to content
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

Trimming implication of IDispatch #1370

Closed
MichalStrehovsky opened this issue Jul 20, 2020 · 2 comments
Closed

Trimming implication of IDispatch #1370

MichalStrehovsky opened this issue Jul 20, 2020 · 2 comments

Comments

@MichalStrehovsky
Copy link
Member

IDispatch COM interface is basically reflection.

We need to investigate what it means for trimming. Does the runtime provide an implementation of this? If so, linker needs to make this 100% work, or surface warnings somehow.

@jkoritzinsky
Copy link
Member

Yes, the runtime provides an implementation of IDispatch and exposes any interfaces marked with [InterfaceTypeAttribute (ComInterfaceType.InterfaceIsIDispatch)]. It also exposes the class type if it is marked with [ClassInterfaceAttribute].

The runtime will also generate an IDispatch interface for any type which is [ComVisible(true)] or that is in an assembly which is [ComVisible(true)] and is not marked [ComVisible(false)]. Members of base classes of ComVisible types can be exposed via IDispatch as well.

@MichalStrehovsky
Copy link
Member Author

Thanks! I ended up having a thread with Aaron on this. We basically decided that we will just try to detect COM and warn on any usage.

#1382 tries to do at least partial detection and issue warnings. There are way too many ways to get to COM in .NET.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants