Open TbOMA opened 1 month ago
How should Orleans serialize LanguageExt.Either<,>
? It cannot automatically serialize unknown types. Do you know if there is an existing library which serializes LanguageExt types? If so, you can likely use that library here. Otherwise, you will need to create surrogate types as described here: https://learn.microsoft.com/en-us/dotnet/orleans/host/configuration-guide/serialization?pivots=orleans-7-0#surrogates-for-serializing-foreign-types
Problem: I am encountering serialization issues with Orleans when using the
LanguageExt.Either<LanguageExt.Common.Error, LanguageExt.Unit>
type in a grain interface (IQuizGrain
).Error Message: Orleans.Runtime.OrleansConfigurationException: Found unserializable or uncopyable types which are being referenced in grain interface signatures: Type: LanguageExt.Either
2[LanguageExt.Common.Error,LanguageExt.Unit] has no serializer or copier and was referenced by the following: MasteryLadder.Quiz.Grains.IQuizGrain,MasteryLadder.Quiz.Grains methods: System.Threading.Tasks.Task
1[LanguageExt.Either`2[LanguageExt.Common.Error,LanguageExt.Unit]] Foo() Ensure that all types which are used in grain interfaces have serializers available for them. Applying the [GenerateSerializer] attribute to your type and adding [Id(x)] attributes to serializable properties and fields is the simplest way to accomplish this.Alternatively, for types which are outside of your control, serializers may have to be manually crafted, potentially using surrogate types.Steps to Reproduce:
IQuizGrain
) that includes a method returningTask<Either<Error, Unit>>
.Expected Behavior: The
LanguageExt.Either<Error, Unit>
type should be correctly serialized and deserialized by Orleans without configuration errors.Actual Behavior: Orleans throws a
OrleansConfigurationException
indicating thatLanguageExt.Either<Error, Unit>
lacks a serializer or copier.Additional Information: