Skip to content

Set the IsDynamicCodeSupported feature to false when using FullAOT #18340

Closed
@rolfbjarne

Description

@rolfbjarne

We need to set the System.Runtime.CompilerServices.RuntimeFeature.IsDynamicCodeSupported feature to false when using FullAOT (i.e. AOT + no interpreter).

This is done by setting the DynamicCodeSupport property to false:

https://github.com/dotnet/sdk/blob/9ca8336afab6247a22e745c2de4960e9b660d164/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.targets#L529-L532

The NativeAOT compiler does that here:

https://github.com/dotnet/sdk/blob/9ca8336afab6247a22e745c2de4960e9b660d164/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Publish.targets#L27

We need to do the same when using MonoAOT + no interpreter.

Metadata

Metadata

Assignees

Labels

app-sizeenhancementThe issue or pull request is an enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions