Skip to content

Conversation

@jonathanpeppers
Copy link
Member

Context: #10699

Bringing useful changes from #10699 to main, such as fixing CoreCLR behavior and updating tests to verify setting $DOTNET_STARTUP_HOOKS works as intended for CoreCLR and NativeAOT.

I will send a future PR to dotnet/runtime to fix Mono.

Context: #10699

Bringing useful changes from #10699 to main, such as fixing CoreCLR
behavior and updating tests to verify setting `$DOTNET_STARTUP_HOOKS`
works as intended for CoreCLR and NativeAOT.

I will send a future PR to dotnet/runtime to fix Mono.
@jonathanpeppers
Copy link
Member Author

There is one test failure Build_From_Clean_DontIncludeRestore.

Due to the flakiness of some of those build perf tests, I am going to do something about them in a different PR.

@jonathanpeppers jonathanpeppers merged commit aae9ef1 into main Feb 3, 2026
5 of 6 checks passed
@jonathanpeppers jonathanpeppers deleted the dev/peppers/startup-hook-fixes branch February 3, 2026 20:23
jonathanpeppers added a commit to jonathanpeppers/runtime that referenced this pull request Feb 3, 2026
Context: https://github.com/dotnet/runtime/blob/741b7157472b9a5c83a78f781ccfa8cd39707763/docs/design/features/host-startup-hook.md
Context: dotnet/android#10755

Mono does not appear to read the `$DOTNET_STARTUP_HOOKS` env var when
calling `System.StartupHookProvider.ProcessStartupHooks()` and only
passes in `""`.

So, to get the same behavior as other runtimes, you would need to
workaround with something like:

    <RuntimeHostConfigurationOption Include="STARTUP_HOOKS" Value="MyStartupHook" Condition=" '$(UseMonoRuntime)' == 'true' " />

Let's read the env var in Mono so that it works the same way as other
runtimes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants