Tagged: serialization

Debugging Serialization Exception: The constructor to deserialize an object was not found.

Today I was debugging an exception that was occuring when remoting a data object between two .NET processes. I kept getting

System.Runtime.Serialization.SerializationException: The constructor to deserialize an object of type 'com.TheSilentGroup.Fluorine.ASObject' was not found.

The issue I had was that there was a .NET object that looked like this

public class ItemDto{
  public object Item { get;set; }
}

Which was used as a covariant store for any item (because everything is an object). This was needed because the code I was working in leveraged reflection to pull out certain fields at runtime depending on whatever this object type really was.

But, at some point the ItemDto object was sent to an ActionScript frontend. Later, the same object came back to .NET and the property Item was now a ASObject type due to Fluorine‘s serialization process. Next, this object had to be serialized to another .NET process, and … Read more