[Mono-bugs] [Bug 331601] New: Can't deserialize a dynamic type

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sat Oct 6 17:48:46 EDT 2007


https://bugzilla.novell.com/show_bug.cgi?id=331601

           Summary: Can't deserialize a dynamic type
           Product: Mono: Runtime
           Version: unspecified
          Platform: Other
        OS/Version: openSUSE 10.2
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: JIT
        AssignedTo: lupus at novell.com
        ReportedBy: ble.jurado at gmail.com
         QAContact: mono-bugs at ximian.com
          Found By: Other


My code is working in .Net but not in Mono. 
I have a dynamic assembly with dynamic types, created through Reflection.Emit.
During the deserializaton, the BinaryFormatter does not find the dynamic type
because it does not find the dynamic assembly. It happens in .Net but I sort it
out by subscribing the AppDomain.CurrentDomain.AssemblyResolve event and
returning the assembly in the handler. 
The event handler is called also on mono at some stage but I guess there is a
later stage in which is should be called again and it is not. 
The exception trace I get is this:

Failures:
1) bindableObjectsTests.BindableObjectsMain.ChangeBindable :
System.Reflection.TargetInvocationException : Exception has been thrown by the
target of an invo
cation.
  ----> System.TypeLoadException : Could not load type
'PropChPrxy_SimpleBusinessObject2409200722, BoxerpDynamicAssembly, Version=
0.0.0.0, 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]
  at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadNextObject
(System.IO.BinaryReader reader) [0x00000]
  at
System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadObjectGraph
(System.IO.BinaryReader reader, Boolean readHeaders, System.Object& result,
System.Runtime.Remoting.Messaging.Header []& headers) [0x00000]
  at
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.NoCheckDeserialize
(System.IO.Stream serializationStream,
System.Runtime.Remoting.Messaging.HeaderHandler handler) [0x00000]
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize
(System.IO.Stream serializationStream) [0x00000]
  at Boxerp.Client.Cloner.GetSerializedClone (System.Object source) [0x0001c]
in
/home/carlos/boxerp/trunk/src/client-lib/client-base/DataBinding/Cloner.cs:19 

I've taken a look at the Mono code and I loose the track in an internal call 
invocation (MonoCMethod.Invoke).

Thanks


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list