2
votes

I'm kind of new to Orleans and using it currently to process incoming events passes to grains using orleans streams. The Orleans client sends to the stream objects of type 'EventData', which are implemented in a separate nuget we consume. On the Orleans silo side, we have a grain with subscribes to this stream using ImplicitStreamSubscription. The grain interface does not uses the 'EventData', and actually the stream subscription is the main entry point for this grain.

The problem I encounter is when the client try to send the 'EventData' instances to the stream, I get back an exception on missing serializer for the 'EventData' class. Marking the 'EventData' class as [Serializable] solved this, but understand does not uses the built-in specialized serializer of Orleans.

How can I get Orleans to use the built-in generated serializers for the 'EventData'?

According to the documentation it seems to be a must to add the orleans templates nuget to the 'EventData' assembly project. Is it indeed? Since it is a nuget which is used in runtime environment other than Orleans, I would like to keep it without any reference to orleans.

1

1 Answers

0
votes

That was answered here: https://github.com/dotnet/orleans/issues/1654

Need to add the following attributes to the grain interface code:

[assembly: KnownType(typeof(EventData))] [assembly: KnownAssembly(typeof(EventData))]