You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The same code shows different output is different when executed using dotnet runtime or run as a NativeAOT (compiled in reflection-free mode). This difference shows only in Reflection-free mode (IlcDisableReflection is set to true in csproj)
Compile code from here
For NativeAOT add these to the csproj file
<ItemGroup>
<PackageReference Include="Microsoft.DotNet.ILCompiler" Version="7.0.0-*" />
</ItemGroup>
<PropertyGroup>
<InvariantGlobalization>true</InvariantGlobalization>
<!-- Note: Program fails only when reflection is completely disabled as below -->
<IlcDisableReflection>true</IlcDisableReflection>
</PropertyGroup>
Description
The same code shows different output is different when executed using dotnet runtime or run as a NativeAOT (compiled in reflection-free mode). This difference shows only in Reflection-free mode (IlcDisableReflection is set to true in csproj)
The sample code is from here
Reproduction Steps
Compile code from here
For NativeAOT add these to the csproj file
Expected behavior
Actual behavior
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response
The text was updated successfully, but these errors were encountered: