Skip to content

Default IsDynamicCodeSupported feature switch to true for CoreCLR #80398

@eerhardt

Description

@eerhardt

With #80246, we added a feature switch for RuntimeFeature.IsDynamicCodeSupported. Previously when you published a trimmed CoreCLR app, RuntimeFeature.IsDynamicCodeSupported was hard-coded to true, so any logic switching on that property was eligible to be trimmed. For example:

RuntimeFeature.IsDynamicCodeSupported ?
new ReflectionEmitCachingMemberAccessor() :
new ReflectionMemberAccessor();

When you publish a CoreCLR trimmed app, the ReflectionMemberAccessor class could be trimmed. Now that we have a feature switch, the property is no longer a constant.

We could enable this by setting featuredefault=true in the ILLink.Substitutions.xml file, but that runs into the issue described in #96539.

This issue is to track enabling this for trimmed CoreCLR applications. It is blocked by #96539.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-System.Reflection.Emitin-prThere is an active PR which will close this issue when it is mergedsize-reductionIssues impacting final app size primary for size sensitive workloads

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions