Bugzilla – Bug 316573
Passing non-serializable classes across appdomains.
Last modified: 2007-09-15 21:24:46 UTC
---- Reported by miguel@ximian.com 2004-12-01 17:35:48 MST ---- The following program produces an exception on Mono: using System; using System.Reflection; using System.Reflection.Emit; class X { static void Main () { AppDomain ad = AppDomain.CreateDomain("MyDomain", AppDomain.CurrentDomain.Evidence); Assembly [] asms = ad.GetAssemblies(); } } The program works as expected on MS.NET The output produced on Mono is: Unhandled Exception: System.Runtime.Serialization.SerializationException: Type System.Reflection.Emit.AssemblyBuilder is not marked as Serializable. Server stack trace: in <0x000be> System.Runtime.Serialization.Formatters.Binary.BinaryCommon:CheckSerializable (System.Type,System.Runtime.Serialization.ISurrogateSelector,System.Runtime.Serialization.StreamingContext) in <0x00166> System.Runtime.Serialization.Formatters.Binary.ObjectWriter:GetObjectData (object,System.Runtime.Serialization.Formatters.Binary.TypeMetadata&,object&) in <0x00044> System.Runtime.Serialization.Formatters.Binary.ObjectWriter:WriteObject (System.IO.BinaryWriter,long,object) in <0x0013d> System.Runtime.Serialization.Formatters.Binary.ObjectWriter:WriteObjectInstance (System.IO.BinaryWriter,object,bool) in <0x00035> System.Runtime.Serialization.Formatters.Binary.ObjectWriter:WriteQueuedObjects (System.IO.BinaryWriter) in <0x00045> System.Runtime.Serialization.Formatters.Binary.ObjectWriter:WriteObjectGraph (System.IO.BinaryWriter,object,System.Runtime.Remoting.Messaging.Header[]) in <0x00230> System.Runtime.Serialization.Formatters.Binary.BinaryFormatter:Serialize (System.IO.Stream,object,System.Runtime.Remoting.Messaging.Header[]) in <0x00015> System.Runtime.Serialization.Formatters.Binary.BinaryFormatter:Serialize (System.IO.Stream,object) in <0x00090> System.Runtime.Remoting.RemotingServices:SerializeCallData (object) in <0x0010d> (wrapper xdomain-dispatch) System.AppDomain:GetAssemblies (object,byte[]&,byte[]&) Exception rethrown at [0]: in <0x00166> (wrapper xdomain-invoke) System.AppDomain:GetAssemblies () in <0x0002b> (wrapper remoting-invoke-with-check) System.AppDomain:GetAssemblies () in <0x00043> X:Main () Notice that AssemblyBuilder is not flagged as serializable on .NET either. ---- Additional Comments From bmaurer@users.sf.net 2004-12-01 18:25:29 MST ---- *** This bug has been marked as a duplicate of https://bugzilla.novell.com/show_bug.cgi?id=MONO69181 *** Unknown operating system unknown. Setting to default OS "Other". This bug was marked DUPLICATE in the database it was moved from. Changing resolution to "MOVED"