[Mono-dev] Serialization issue with anonymous methods?

Johan Hernandez thepumpkin1979 at gmail.com
Thu Nov 16 01:55:47 EST 2006


Hi my name is Johan Hernandez(excuse me for my english). I was looking for a
list of known issues for Mono 1.2 but I can't find it, so I will post my
issue here. Please compile the attachments in this mail and run the
sample. I got this Serialization error:

SerializationException
"'MyApp.MainClass+<>c__CompilerGenerated1 is nor marked as serializable"

My class 'MyApp.MainClass contains a method(the Application Main Method)
with a anonymous method like this:
/*
  d.UnhandledException+= delegate {
   Console.WriteLine("Log Exception inside the application domain");
   };
*/
... where "d" is a AppDomain instance running and raising exceptions. When
the first exception is throwed
the SerializationException occurs.

The "c__CompilerGenerated1" type is generated by the compiler but it is not
marked as serializable by default.

I am just thinkin that this is the cause but i'm not sure because I not able
to run MS ILDASM on a Mono Assembly and Mono Package don't have this tool.

This issue is not present in MS .NET 2.0.

I hope this is helpful.

Best regards, Johan Hernandez.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20061116/0882e088/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CompileERROR.bat_
Type: application/octet-stream
Size: 79 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20061116/0882e088/attachment.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CompileOK.bat_
Type: application/octet-stream
Size: 55 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20061116/0882e088/attachment-0001.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Dragon.cs_
Type: application/octet-stream
Size: 697 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20061116/0882e088/attachment-0002.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MainClass.cs_
Type: application/octet-stream
Size: 1819 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20061116/0882e088/attachment-0003.obj 


More information about the Mono-devel-list mailing list