-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
ComponentActivator will always be removed by trimming #15272
Comments
I think this goes back to our discussion about the lack of proper support for this scenario. SDK doesn't know that it's building an application which will be loaded "in a special way". So it builds it as usual and trims everything it won't need.
For now the fix could be to use the existing trimmer annotations to pull the necessary bits together:
I do agree that |
Adding a feature-switch sounds like the right thing to do. I think the feature switch should be specific to In #12043, I was told this would "create a third bucket" and was not desirable. I hope that it's becoming obvious that there is a need for this third bucket. Naturally, I would like this new MSBuild property to "implement" #12043 such that these projects would use this new property and have |
I agree that on the SDK side this could be implemented by something similar to I think the important part is that this is "external knowledge" - SDK has no way to tell from the project itself that it's going to be used like this since it doesn't see the native side of things - so in that sense it can't really be tied to the |
The new property |
It could, but I hope people using this property will know exactly what they're doing. The new property starts with Another consideration is that trimming is currently only supported for apps (not libraries) and apps already effectively imply |
This is the application/component hybrid scenario from dotnet/runtime#35465. When building as self-contained with trimming (either
CopyUsed
orLink
), the custom native host is unable to callget_function_pointer
for its custom entry point. Adding the following code makes it work, but is not ideal becauseComponentActivator
is an internal implementation detail that is subject to change in future releases of .NET.Also if the application itself is trimmed, I don't know how to mark the delegate and/or the entry point method such that the linker knows not to trim it.
The text was updated successfully, but these errors were encountered: