I'm trying to send one dynamic object (type ExpandoObject
) from the main AppDomain to another, and obviously faced the ExpandoObject is not marked as serializable
exception.
In addition, this ExpandoObject
has inner dictionary member (Dictionary <object, dynamic>
) for my needs.
I already tried converting the ExpandoObject
into Json using Json.Net (JObject
) but the inner dictionaries aren't deserialized as arrays, giving me an exception when trying to access its properties.
Does anyone know how to serialize an dynamic object and sending it to another AppDomain?
Main AppDomain Code:
dynamic dynamicObj = expBuilder.GenerateDynamicObj();
ExpressionInMemory exp = (ExpressionInMemory)ExpressionDomain.CreateInstanceAndUnwrap(Assembly.GetExecutingAssembly().FullName, typeof(ExpressionInMemory).FullName);
exp.SetDynamicObj(dynamicObj);
Alternative AppDomain Code:
...
public void SetDynamicObj(dynamic obj)
{
this._dynamicObj = obj;
}
...