-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
GeneratedComClass doesn't apply to inherited classes #94357
Comments
Tagging subscribers to this area: @dotnet/interop-contrib Issue DetailsPlacing GeneratedComClass on a base class doesn't enable deriving types to work with source generated COM. Should we check for base classes that have the IComExposedDetails as well here?
|
I'd like to understand this scenario before we go after it. I have some questions about how overrides are expected to and what benefits we gain as opposed to just having people place it on the most derived type. |
The more I think about it, I'm not sure there's a great way to do this without breaking trimming and AOT. Maybe we should just require it on all classes that are exposed to COM. |
There's also no efficient way to detect this scenario in a source generator. We should just require it on all classes that are exposed to COM. |
Nice. Does it make sense to detect that if the immediate base class has |
Yes, we can write an analyzer that detects that case and emits a warning in an efficient way. |
Placing GeneratedComClass on a base class doesn't enable deriving types to work with source generated COM.
Should we check for base classes that have the IComExposedDetails as well here?
https://github.com/dotnet/runtime/blob/df6fdefa27068126794b253d4d822706221a92db/src/libraries/System.Runtime.InteropServices/src/System/Runtime/InteropServices/Marshalling/IComExposedDetails.cs#L21C49-L21C49
The text was updated successfully, but these errors were encountered: