[Mono-list] dynamic types serialization - AssemblyResolve

Carlos Ble ble.jurado at gmail.com
Mon Sep 24 17:40:56 EDT 2007

The AssemblyResolve event handler is being called and the assembly is loaded
and returned so that is not the problem.
Here is the stack trace:

1) bindableObjectsTests.BindableObjectsMain.ChangeBindable :
System.Reflection.TargetInvocationException : Exception has been thrown by
the target of an invo
  ----> System.TypeLoadException : Could not load type
'PropChPrxy_SimpleBusinessObject2409200722, BoxerpDynamicAssembly, Version=, Culture=neutral, PublicKeyToken=null'.
  at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags
invokeAttr, System.Reflection.Binder binder, System.Object[] parameters,
System.Globalization.CultureInfo culture) [0x00000]
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[]
parameters) [0x00000]
  at System.Runtime.Serialization.ObjectRecord.LoadData (
System.Runtime.Serialization.ObjectManager manager, ISurrogateSelector
selector, StreamingContext context) [0x00000]
  at System.Runtime.Serialization.ObjectManager.DoFixups () [0x00000]
System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadNextObject (
System.IO.BinaryReader reader) [0x00000]
System.IO.BinaryReader reader, Boolean readHeaders, System.Object& result,
System.Runtime.Remoting.Messaging.Header[]& headers) [0x00000]
System.IO.Stream serializationStream,
System.Runtime.Remoting.Messaging.HeaderHandler handler) [0x00000]
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize (
System.IO.Stream serializationStream) [0x00000]
  at Boxerp.Client.Cloner.GetSerializedClone (System.Object source)
[0x0001c] in

The source code of the project is entirely in the its subversion repository
and it's public if anyone wants to try it.
There are a Monodevelop project for the library and a Monodevelop project
for the unit tests.

I can try to dig into the Mono code so any clue would be appreciated.


2007/9/24, Carlos Ble <ble.jurado at gmail.com>:
> Hi!
> I'm having problems to serialize a dynamic type created with
> Reflection.Emit. The BinaryFormatter does not find the
> dynamic assembly. That is normal but I've fixed that in .Net, subscribing
> a handler to the  AppDomain.CurrentDomain.AssemblyResolve,
> so that I can load the assembly properly. This is not working in Mono, I
> think the event is not raised although I need to debug a bit more.
> Is this a know issue?.
> I have the classes and more info in this post:
> http://www.carlosble.com/?p=91
> Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20070924/378713f4/attachment-0001.html 

More information about the Mono-list mailing list