Hi,
I have a problem.
I've noticed that when you use
AppDomain.CreateDomain("name");
and somewhere in your app, there is a reference to the MonobjC assembly,
it throws an exception.
In other words, it's not possible to create a second AppDomain.
Is there any way to get around this?
In the second AppDomain, I don't even need Monobjc...
The exception can be found below.
Thanks,
- Kenny
Exception:
TypeInitializationException
An exception was thrown by the type initializer for
System.Runtime.Serialization.Formatters.Binary.CodeGenerator
at
System.Runtime.Serialization.Formatters.Binary.ObjectWriter.CreateMemberTypeMetadata
(System.Type type) [0x00000]
at
System.Runtime.Serialization.Formatters.Binary.ObjectWriter.GetObjectData (System.Object
obj, System.Runtime.Serialization.Formatters.Binary.TypeMetadata&
metadata, System.Object& data) [0x00000]
at
System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObject
(System.IO.BinaryWriter writer, Int64 id, System.Object obj) [0x00000]
at
System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObjectInstance
(System.IO.BinaryWriter writer, System.Object obj, Boolean
isValueObject) [0x00000]
at
System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteQueuedObjects
(System.IO.BinaryWriter writer) [0x00000]
at
System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObjectGraph
(System.IO.BinaryWriter writer, System.Object obj,
System.Runtime.Remoting.Messaging.Header[] headers) [0x00000]
at
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize
(System.IO.Stream serializationStream, System.Object graph,
System.Runtime.Remoting.Messaging.Header[] headers) [0x00000]
at
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize
(System.IO.Stream serializationStream, System.Object graph) [0x00000]
at System.Runtime.Remoting.Channels.CADSerializer.SerializeObject
(System.Object obj) [0x00000]
at System.Runtime.Remoting.Messaging.CADMethodCallMessage..ctor
(IMethodCallMessage callMsg) [0x00000]
at System.Runtime.Remoting.Messaging.CADMethodCallMessage.Create
(IMessage callMsg) [0x00000]
at
System.Runtime.Remoting.Channels.CrossAppDomainSink.SyncProcessMessage
(IMessage msgRequest) [0x00000]
InnerException: NotSupportedException
The invoked member is not supported in a dynamic module.
at System.Reflection.Emit.AssemblyBuilder.GetExportedTypes () [0x00000]
at Monobjc.ObjectiveCRuntime.ScanAssembly (System.Reflection.Assembly
assembly) [0x00000]
at Monobjc.ObjectiveCRuntime.CurrentDomain_AssemblyLoad
(System.Object sender, System.AssemblyLoadEventArgs args) [0x00000]
at System.AppDomain.DoAssemblyLoad (System.Reflection.Assembly
assembly) [0x00000]
at (wrapper managed-to-native)
System.Reflection.Emit.AssemblyBuilder:basic_init
(System.Reflection.Emit.AssemblyBuilder)
at System.Reflection.Emit.AssemblyBuilder..ctor
(System.Reflection.AssemblyName n, System.String directory,
AssemblyBuilderAccess access, Boolean corlib_internal) [0x00000]
at System.AppDomain.DefineInternalDynamicAssembly
(System.Reflection.AssemblyName name, AssemblyBuilderAccess access)
[0x00000]
at (wrapper remoting-invoke-with-check)
System.AppDomain:DefineInternalDynamicAssembly
(System.Reflection.AssemblyName,System.Reflection.Emit.AssemblyBuilderAccess)
at
System.Runtime.Serialization.Formatters.Binary.CodeGenerator..cctor ()
[0x00000]