-
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
Handling of startup hooks in linked applications #36526
Comments
Tagging subscribers to this area: @safern, @ViktorHofer |
Moving to 6.0 since this scenario isn't needed for Blazor WASM apps. |
I think startup hooks should be behind a feature switch as that is the only reliable solution to this - trimmed apps can't use startup hooks to their full potential. For some specific cases, where the startup hook assembly is known before hand (for example since it's part of the target environment - hosting provider telemetry, ...) it might be possible to make this work by:
|
Tagging subscribers to this area: @vitek-karas, @agocke |
The startup hook feature is inherently linker unfriendly as it loads "random" assemblies and executes code in them. As such using it on applications which are trimmed by the linker is problematic and likely to break the app or the startup hook.
This issue is to determine if there's some technical solution we can implement to make this more predictable experience.
Linker will also mark the implementation code in CoreLib as unfriendly and this will need some changes (either suppression, feature switch or something else):
runtime/src/coreclr/src/System.Private.CoreLib/src/System/StartupHookProvider.cs
Line 100 in ec2209e
Potentially related feature might be marking assemblies which were linked per dotnet/linker#1194 as that could be used to detect linked apps by the customers.
The text was updated successfully, but these errors were encountered: