Skip to content

Handling of startup hooks in linked applications #36526

@vitek-karas

Description

@vitek-karas

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):

private static void CallStartupHook(StartupHookNameOrPath startupHook)

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions