Skip to content

IL3050/IL2026 - StringTests, TimeZoneInfoTests fail AOT/trimmer analysis in System.Runtime.IOS.Tests #127445

@pavelsavara

Description

@pavelsavara
##[error]src/libraries/System.Runtime/tests/System.Runtime.Tests/System/StringTests.cs(1137,92): error IL3050: (NETCORE_ENGINEERING_TELEMETRY=Build) Using member 'System.Enum.GetValues(Type)' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. It might not be possible to create an array of the enum type at runtime. Use the GetValues<TEnum> overload or the GetValuesAsUnderlyingType method instead.
/Users/runner/work/1/s/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/StringTests.cs(1137,92): error IL3050: Using member 'System.Enum.GetValues(Type)' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. It might not be possible to create an array of the enum type at runtime. Use the GetValues<TEnum> overload or the GetValuesAsUnderlyingType method instead. [/Users/runner/work/1/s/src/libraries/System.Runtime/tests/System.Runtime.Tests/Hybrid/System.Runtime.IOS.Tests.csproj::TargetFramework=net11.0-tvos]
##[error]src/libraries/System.Runtime/tests/System.Runtime.Tests/System/TimeZoneInfoTests.cs(2181,17): error IL2026: (NETCORE_ENGINEERING_TELEMETRY=Build) Using member 'System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream, Object)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. BinaryFormatter serialization is not trim compatible because the type of objects being processed cannot be statically discovered.
/Users/runner/work/1/s/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/TimeZoneInfoTests.cs(2181,17): error IL2026: Using member 'System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream, Object)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. BinaryFormatter serialization is not trim compatible because the type of objects being processed cannot be statically discovered. [/Users/runner/work/1/s/src/libraries/System.Runtime/tests/System.Runtime.Tests/Hybrid/System.Runtime.IOS.Tests.csproj::TargetFramework=net11.0-tvos]
##[error]src/libraries/System.Runtime/tests/System.Runtime.Tests/System/TimeZoneInfoTests.cs(2184,67): error IL2026: (NETCORE_ENGINEERING_TELEMETRY=Build) Using member 'System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. BinaryFormatter serialization is not trim compatible because the type of objects being processed cannot be statically discovered.
/Users/runner/work/1/s/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/TimeZoneInfoTests.cs(2184,67): error IL2026: Using member 'System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. BinaryFormatter serialization is not trim compatible because the type of objects being processed cannot be statically discovered. [/Users/runner/work/1/s/src/libraries/System.Runtime/tests/System.Runtime.Tests/Hybrid/System.Runtime.IOS.Tests.csproj::TargetFramework=net11.0-tvos]
##[error]src/libraries/System.Runtime/tests/System.Runtime.Tests/System/TimeZoneInfoTests.cs(2184,67): error IL3050: (NETCORE_ENGINEERING_TELEMETRY=Build) Using member 'System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream)' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. BinaryFormatter serialization uses dynamic code generation, the type of objects being processed cannot be statically discovered.
/Users/runner/work/1/s/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/TimeZoneInfoTests.cs(2184,67): error IL3050: Using member 'System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream)' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. BinaryFormatter serialization uses dynamic code generation, the type of objects being processed cannot be statically discovered. [/Users/runner/work/1/s/src/libraries/System.Runtime/tests/System.Runtime.Tests/Hybrid/System.Runtime.IOS.Tests.csproj::TargetFramework=net11.0-tvos]
##[error]src/libraries/System.Runtime/tests/System.Runtime.Tests/System/TimeZoneInfoTests.cs(2229,61): error IL2075: (NETCORE_ENGINEERING_TELEMETRY=Build) 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.NonPublicProperties' in call to 'System.Type.GetProperty(String, BindingFlags)'. The return value of method 'System.Object.GetType()' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
/Users/runner/work/1/s/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/TimeZoneInfoTests.cs(2229,61): error IL2075: 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.NonPublicProperties' in call to 'System.Type.GetProperty(String, BindingFlags)'. The return value of method 'System.Object.GetType()' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. [/Users/runner/work/1/s/src/libraries/System.Runtime/tests/System.Runtime.Tests/Hybrid/System.Runtime.IOS.Tests.csproj::TargetFramework=net11.0-tvos]
##[error]src/libraries/System.Runtime/tests/System.Runtime.Tests/System/StringTests.cs(1312,43): error IL3050: (NETCORE_ENGINEERING_TELEMETRY=Build) Using member 'System.Reflection.Emit.DynamicMethod.DynamicMethod(String, Type, Type[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. Creating a DynamicMethod requires dynamic code.
/Users/runner/work/1/s/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/StringTests.cs(1312,43): error IL3050: Using member 'System.Reflection.Emit.DynamicMethod.DynamicMethod(String, Type, Type[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. Creating a DynamicMethod requires dynamic code. [/Users/runner/work/1/s/src/libraries/System.Runtime/tests/System.Runtime.Tests/Hybrid/System.Runtime.IOS.Tests.csproj::TargetFramework=net11.0-tvos]
##[error]src/libraries/System.Runtime/tests/System.Runtime.Tests/System/StringTests.cs(1279,47): error IL3050: (NETCORE_ENGINEERING_TELEMETRY=Build) Using member 'System.Reflection.Emit.DynamicMethod.DynamicMethod(String, Type, Type[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. Creating a DynamicMethod requires dynamic code.
/Users/runner/work/1/s/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/StringTests.cs(1279,47): error IL3050: Using member 'System.Reflection.Emit.DynamicMethod.DynamicMethod(String, Type, Type[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. Creating a DynamicMethod requires dynamic code. [/Users/runner/work/1/s/src/libraries/System.Runtime/tests/System.Runtime.Tests/Hybrid/System.Runtime.IOS.Tests.csproj::TargetFramework=net11.0-tvos]

Build Information

Build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1394339&view=results
Build error leg or test failing: System.Runtime.IOS.Tests

Error Message

Fill the error message using step by step known issues guidance.

{
  "ErrorMessage": "error IL3050",
  "BuildRetry": false,
  "ExcludeConsoleLog": true
}

Known issue validation

Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=1394339
Error message validated: [error IL3050]
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 4/27/2026 9:50:42 AM UTC

Report

Build Definition Step Name Console log Pull Request
1394339 dotnet/runtime Build product Log

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
0 1 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Known Build ErrorUse this to report build issues in the .NET Helix tabarea-Infrastructureblocking-clean-ciBlocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms'os-iosApple iOSuntriagedNew issue has not been triaged by the area owner

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions