Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when serializing base types in hierarchies #9199

Open
octavian-niculescu10 opened this issue Oct 22, 2024 · 8 comments
Open

Error when serializing base types in hierarchies #9199

octavian-niculescu10 opened this issue Oct 22, 2024 · 8 comments

Comments

@octavian-niculescu10
Copy link

octavian-niculescu10 commented Oct 22, 2024

Hello,
I am trying to run a simple TestClusterBuilder, like this:

var builder = new TestClusterBuilder();
var cluster = builder.Build();
cluster.Deploy();
[GenerateSerializer]
public sealed class MyIds : Collection<MyId>
{
}

[GenerateSerializer]
public sealed record MyId(Guid Value)
{
    
}

and I am getting:

System.Collections.Generic.KeyNotFoundException : Could not find a base type serializer for type System.Collections.ObjectModel.Collection`1[namespace.....MyId].

Do you have any idea why this might be happening?

I tried removing the "sealed" keyword too and it didn't change anything.

@octavian-niculescu10 octavian-niculescu10 changed the title System.ArgumentException : The number of generic arguments provided doesn't equal the arity of the generic type definition. (Parameter 'instantiation') Error when serializing base types in hierarchies Oct 22, 2024
@ReubenBond
Copy link
Member

@octavian-niculescu10 which version of Orleans are you using?

@octavian-niculescu10
Copy link
Author

@ReubenBond version 7.2.6. I had to write a codec so it could work

@ReubenBond
Copy link
Member

This is a bug we need to fix by implementing IBaseCodec on CollectionCodec, similar to List

@octavian-niculescu10
Copy link
Author

Thank you!

@ReubenBond
Copy link
Member

I opened #9200 as a sub issue to fix this one.

@octavian-niculescu10
Copy link
Author

Thanks. I've just read the issue you mentioned - should it be working with GroupIds : List instead of GroupIds : Collection? because it's not :)

@ReubenBond
Copy link
Member

If you inherit from List<T> instead of Collection<T>, it will work with v8.2.0 (#9005)

@octavian-niculescu10
Copy link
Author

Got it, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants