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

ComActivator will always be removed by trimming #43606

Closed
vitek-karas opened this issue Oct 19, 2020 · 2 comments · Fixed by #54524
Closed

ComActivator will always be removed by trimming #43606

vitek-karas opened this issue Oct 19, 2020 · 2 comments · Fixed by #54524
Assignees
Labels
area-Interop-coreclr in-pr There is an active PR which will close this issue when it is merged linkable-framework Issues associated with delivering a linker friendly framework
Milestone

Comments

@vitek-karas
Copy link
Member

The ComActivator class has no direct dependencies on it anywhere from the managed code. It's also not rooted by anything in the CoreLib's descriptor or otherwise. As such trimming will always remove it.

The class is only used in COM server scenarios. It's referred to from hostpolicy when asked to create COM activation delegate. (also for COM register and unregister delegates).

Note: Currently .NET 5 doesn't support self-contained components and so the most typical COM Server will not actually ever have this problem (since trimming won't make sense for FDD components).

If there is a scenario where a full application also enables COM Server functionality (not sure if this is actually possible currently) then trimming such application would break that functionality.

In theory this might be solvable if we really wanted to:

  • There's already an MSBuild property which effectively acts like the COM Server feature switch EnableComHosting - we could turn that into a real feature switch and make the ComActivator rooted conditionally in that case.
  • Note that it would not be enough to make COM Servers work, since the classes potentially instantiated by the ComActivator may still be trimmed away. To make this work, we would have tie trimming into the CLSIDMap creation in SDK and make it produce an ILLink descriptor which would root the necessary classes which are registered for COM activation.
@vitek-karas vitek-karas added area-Interop-coreclr linkable-framework Issues associated with delivering a linker friendly framework labels Oct 19, 2020
@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the untriaged New issue has not been triaged by the area owner label Oct 19, 2020
@vitek-karas
Copy link
Member Author

Also related to the COM Feature switch which should obviously turn everything COM related off - #36659

@AaronRobinsonMSFT AaronRobinsonMSFT removed the untriaged New issue has not been triaged by the area owner label Oct 26, 2020
@AaronRobinsonMSFT AaronRobinsonMSFT added this to the 6.0.0 milestone Oct 26, 2020
@eerhardt
Copy link
Member

@LakshanF - is this something you plan on addressing in 6.0? If not, can you move it to "Future"?

@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Jun 21, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Jul 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Interop-coreclr in-pr There is an active PR which will close this issue when it is merged linkable-framework Issues associated with delivering a linker friendly framework
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants