[Mono-devel-list] can't AppDomain under the mint

Хорольский Андрей Николаевич AndreyNH at office.optima.ru
Mon May 19 09:34:35 EDT 2003


when I run below program under the mint(0.24&snapshort-18-May) I've got
exception:

Unhandled Exception: System.InvalidCastException: Cannot cast from source
type to destination type
#0: 0x0004b castclass  in
System.Runtime.Serialization.Formatters.Binary.ObjectWriter::WriteObjectInst
ance ([0x8173880] [0x811dcd8] )
#1: 0x00012 callvirt   in
System.Runtime.Serialization.Formatters.Binary.ObjectWriter::WriteQueuedObje
cts ([0x8173880] )
#2: 0x00021 callvirt   in
System.Runtime.Serialization.Formatters.Binary.ObjectWriter::WriteObjectGrap
h ([0x8173880] [0x8169c08] [(nil)] )
#3: 0x0008a callvirt   in
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter::Serialize
([0x81238d0] [0x8169c08] [(nil)] )
#4: 0x00004 callvirt   in
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter::Serialize
([0x81238d0] [0x8169c08] )
#5: 0x0001a callvirt   in
System.Runtime.Remoting.Channels.CADSerializer::SerializeObject ([0x8169c08]
)
#6: 0x00017 call       in System.AppDomain::GetMarshalledDomainObjRef ()
#7: 0x00010 callvirt   in
System.Runtime.Remoting.RemotingServices::GetDomainProxy ([0x8123cc0] )
#8: 0x00029 call       in System.AppDomain::CreateDomain ([0x816bfd8]
[0x816bf78] [0x8122ec0] )
#9: 0x0000b call       in System.AppDomain::CreateDomain ([0x816bfd8] )
#10: 0x00005 call       in .R::Main ()

#
// Creating AppDomains from within AppDomains seems to cause problems
using System;
using System.Diagnostics;

public class X : MarshalByRefObject {

      public void Run ()
      {
        Console.WriteLine ("inside X; current domain: {0}",
AppDomain.CurrentDomain);
        AppDomainSetup ads = new AppDomainSetup ();
      }
    }

    public class R {
      public static void Main ()
      {
        AppDomain domain = AppDomain.CreateDomain ("X");
        Type t = typeof(X);
        X x = (X) domain.CreateInstanceAndUnwrap (t.Assembly.FullName,
t.FullName);
        x.Run ();
      }
    }

I've no such problems with mono/oldmono. Any suggestions would be greatly
appreciated.



More information about the Mono-devel-list mailing list