Skip to content

Generic interface desserialization failure #60

@Lexy2

Description

@Lexy2

Consider the following scenario:
I have a method defined as
public Task<IList<string>> GetListAsync(), in an IRpcService. The client application is targeting net472, and the server application is targeting net10.0.
The server implementation is returning just new List().
The client is calling var list = await GetListAsync();

Expected result
Empty list is returned.

Actual result

System.Runtime.Serialization.SerializationException: Cannot deserialize inbound call arguments. ---> System.Collections.Generic.KeyNotFoundException: Type 'System.Collections.Generic.List`1[[System.String, System.Private.CoreLib]], System.Private.CoreLib' is not found.
   at Type ActualLab.Reflection.TypeRef.Resolve()
   at Type ActualLab.Rpc.Serialization.Internal.ByteTypeSerializer.FromBytes(ByteString bytes)+(ByteString b) => { }
   at TValue System.Collections.Concurrent.ConcurrentDictionary<TKey, TValue>.GetOrAdd(TKey key, Func<TKey, TValue> valueFactory)
   at Type ActualLab.Rpc.Serialization.Internal.ByteTypeSerializer.FromBytes(ByteString bytes)
   at Type ActualLab.Rpc.Serialization.Internal.ByteTypeSerializer.ReadItemType(ref ReadOnlyMemory<byte> data)
   at Type ActualLab.Rpc.Serialization.Internal.ByteTypeSerializer.ReadDerivedItemType(ref ReadOnlyMemory<byte> data, Type expectedType)
   at void ActualLab.Rpc.Serialization.RpcByteArgumentSerializerV4.PolyDeserialize(ArgumentList arguments, ReadOnlyMemory<byte> data)
   at void ActualLab.Rpc.Serialization.RpcByteArgumentSerializerV4.Deserialize(ref ArgumentList arguments, bool needsPolymorphism, ReadOnlyMemory<byte> data)
   at ArgumentList ActualLab.Rpc.Infrastructure.RpcInboundCall.DeserializeArguments()
   at Task ActualLab.Rpc.Infrastructure.RpcInboundCall.Process(CancellationToken cancellationToken)

If I change the interface to request Task<List<string>>, the call succeeds.

Tried with 12.1.61.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions