Serialization error while deleting Reliable Actors and their state

In Service Fabric when an Actor is deactivated the actor object itself is being cleaned up. The state stored in the actor’s State Manager is not being removed in case of actor garbage collection. This is due to the fact that an actor is reactivated its data is again made available through the State Manager.

In our use case some of these actors are never being reactivated and therefore it is necessary to do ‘manual’ clean up of their data.

Deleting the Actor

To delete our Reliable Actor and his associated stated we used the code sample provided on and used the function provided by the Actor Service to delete the actors from a remote caller.

When using the above code sample we ran into serialization errors.

Element ‘’ contains data from a type that maps to the name ‘urn:ServiceFabric.Communication:ServiceResponseMessageHeaders’. The deserializer has no knowledge of any type that maps to this name. Consider using a DataContractResolver if you are using DataContractSerializer or add the type corresponding to ‘ServiceResponseMessageHeaders’ to the list of known types – for example, by using the KnownTypeAttribute attribute or by adding it to the list of known types passed to the serializer.

After some investigation we came to the conclusion that this issue was related to the incompatibility of V1 and V2 remoting in Service Fabric. The IActorService Proxy we assigned with the sample code of was providing us with a V1 remoting endpoint.

To solve this, and to use the correct V2 remoting endpoint we used the implementation below.

Hope you find it helpful, someday!





Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s