I am getting a SerializationException for an enum when calling from one AppDomain into another:
System.Runtime.Serialization.SerializationException: Type is not resolved for member 'Dummy.MyEnum,Dummy, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
Sample code:
public enum MyEnum
{
A = 0,
B = 1,
C = 2,
}
public class FooBar : MarshalByRefObject
{
public void Test1(MyEnum dummy)
{
}
public void Test2(object dummy)
{
}
}
This call will throw the exception:
getFooBarInOtherAppDomain().Test1(MyEnum.A);
When using any other serializable type it succeeds:
getFooBarInOtherAppDomain().Test2(0);
Caller, callee and enum are defined in the same assembly.
What does .Net mean with "Type is not resolved" and why is the exception thrown? Aren't enums serializable by default?