Skip to content

Add support for host startup hooks to Mono #47462

@lambdageek

Description

@lambdageek

The dotnet core host supports host startup hooks to inject assemblies to run before the main method.

We should implement support for this in Mono.


However for some use cases, such as mobile workloads, it is not enough to add runtime support - we will also need workload integration to bundle the startup hook assemblies into the mobile apps. At that point it may make sense to use a more static approach - instead of inspecting an environment variable and doing method lookup using reflection, just execute the hooks directly from the mobile embedders before the runtime starts (or pass a less dynamic structure to the runtime to execute the methods on the embedders' behalf).

Also need to investigate if in general we need to give the embedders a way to identify the right time to run the startup hooks (for example after some managed code executes to set up the Android or ios environment).

Additionally if the startup hooks need any special permissions beyond what the app needs, the workloads need to be involved.


In scenarios where MonoVM may be substituted for CoreCLR (ie console apps) we should implement the startup hook support as spec'd.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions