Description
A net10.0 win-x64 NativeAOT executable fails while resolving an ordinary Serializer<T> after new ServiceCollection().AddSerializer().BuildServiceProvider(). The failure occurs before the generated payload codec accesses any fields:
System.TypeLoadException: Could not resolve type 'System.ValueTuple`8' in assembly 'System.Private.CoreLib, Version=10.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'.
at System.Reflection.Runtime.TypeInfos.RuntimeTypeInfo.GetInterfaces()
at Orleans.Serialization.TypeSystem.TypeConverter.<ConsumeMetadata>g__AddFromMetadata|18_0(HashSet<Type>, Type)
at Orleans.Serialization.TypeSystem.TypeConverter.ConsumeMetadata(TypeManifestOptions)
at Orleans.Serialization.TypeSystem.TypeConverter..ctor(...)
Reproduction and environment
Observed on dotnet/orleans main commit ef8c404757, Windows x64, .NET SDK 10.0.401/runtime 10.0.12, with a focused private-field source-generator change. A dedicated executable has project-local <PublishAot>true</PublishAot> and calls ordinary typed Serializer<T>/DeepCopier. Closed generated codec/copier implementations are explicitly registered through DI. Payloads contain private/readonly fields and auto-property backing fields. The same flows pass under JIT.
The native publish requires ILLinkTreatWarningsAsErrors=false to keep existing full-serialization trim/AOT diagnostics visible (ExceptionCodec, SerializationConstructorFactory and CodecProvider). No diagnostics are suppressed in the library. Compilation/linking succeeds; native execution fails during TypeConverter construction.
Expected behavior
The default generated/built-in type manifest should preserve the interface metadata required by TypeConverter and CodecProvider consumption, allowing startup for statically rooted supported payloads.
Investigation scope
Inspect metadata preservation for built-in generic tuple codecs/copiers and their implemented interfaces, especially ValueTuple<,,,,,,,>. This is separate from generated private-field access and from runtime generic codec activation. General NativeAOT discussion #9639 exists but does not track this concrete startup failure.
Description
A net10.0 win-x64 NativeAOT executable fails while resolving an ordinary
Serializer<T>afternew ServiceCollection().AddSerializer().BuildServiceProvider(). The failure occurs before the generated payload codec accesses any fields:Reproduction and environment
Observed on dotnet/orleans main commit
ef8c404757, Windows x64, .NET SDK 10.0.401/runtime 10.0.12, with a focused private-field source-generator change. A dedicated executable has project-local<PublishAot>true</PublishAot>and calls ordinary typedSerializer<T>/DeepCopier. Closed generated codec/copier implementations are explicitly registered through DI. Payloads contain private/readonly fields and auto-property backing fields. The same flows pass under JIT.The native publish requires
ILLinkTreatWarningsAsErrors=falseto keep existing full-serialization trim/AOT diagnostics visible (ExceptionCodec, SerializationConstructorFactory and CodecProvider). No diagnostics are suppressed in the library. Compilation/linking succeeds; native execution fails during TypeConverter construction.Expected behavior
The default generated/built-in type manifest should preserve the interface metadata required by TypeConverter and CodecProvider consumption, allowing startup for statically rooted supported payloads.
Investigation scope
Inspect metadata preservation for built-in generic tuple codecs/copiers and their implemented interfaces, especially
ValueTuple<,,,,,,,>. This is separate from generated private-field access and from runtime generic codec activation. General NativeAOT discussion #9639 exists but does not track this concrete startup failure.