Skip to content

[release/10.0] Avoid marking types as reflected on in CreateSpan #118908

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

Open
wants to merge 2 commits into
base: release/10.0
Choose a base branch
from

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Aug 19, 2025

Backport of #118832 to release/10.0

/cc @MichalStrehovsky

Customer Impact

  • Customer reported
  • Found internally

We're significantly improving publish AOT size for small apps in 10.0. Linux didn't see the same size savings due to the issue fixed here.

Regression

  • Yes
  • No

Testing

rt-sz size tests, outerloop run.

Risk

The risk is low, calls to this method get expanded by RyuJIT and the body is generally not looked at. Instead of doing work and then throwing an exception, we skip the work and throw exception directly.

IMPORTANT: If this backport is for a servicing release, please verify that:

  • The PR target branch is release/X.0-staging, not release/X.0.

Package authoring no longer needed in .NET 9

IMPORTANT: Starting with .NET 9, you no longer need to edit a NuGet package's csproj to enable building and bump the version.
Keep in mind that we still need package authoring in .NET 8 and older versions.

This seems to be at least one of the reasons why Hello World on Linux still needs support for boxed enums. `CreateSpan` is used with an enum type in Unix System.Console, which brings a boxed enum into whole program view and we can't undo the damage this causes to the whole program view during compilation anymore (even though we no longer need the `typeof` then because RyuJIT always expands `CreateSpan`).
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.

1 participant