[OBORONA-SPAM] [Mono-list] AppDomain problems

Vadim B. Guzev vguzev@yandex.ru
Mon, 17 May 2004 19:14:01 +0400


I've had the same problem on RH9 with mono beta 9 and I came to decision not
to use AppDomains (and rewrite all existing code on the basis of
System.Diagnostics.Process) in Mono for the future as it's a great source of
errors and headache... :-(
There're a lot of errors over there I think... for example it's impossible
to create AppDomain with GC turned off... sometimes unloading of AppDomains
doesn't work properly... sometimes I get strange errors and warnings when
working with AppDomains... and so on...

But, if you still want to run your example on RH9 try to turn off the NPTL!
To do this compile Mono sources like this:
./configure --prefix=/your/installation/path --with-nptl=no
make
make install

Best regards,
Vadim B. Guzev
http://u.pereslavl.ru/~vadim/MCSharp/

----- Original Message ----- 
From: "RoBiK" <robik@mailbox.sk>
To: <mono-list@lists.ximian.com>
Sent: Monday, May 17, 2004 4:21 PM
Subject: [OBORONA-SPAM] [Mono-list] AppDomain problems


> Hi, i try to use an AppDomain, but have serious problems. I'm using RH9
> wirt mono beta 1 instaleld from the rpms.
>
> Test program:
>
> using System;
>
> class Test : MarshalByRefObject
> {
> public void DoTest()
> {
> Console.WriteLine("DoTest()");
> }
> }
>
> class MainClass
> {
> public static void Main(string[] args)
> {
> AppDomain ad = AppDomain.CreateDomain("Test");
> Test t = (Test)ad.CreateInstanceAndUnwrap("AppDomainTest", "Test");
> t.DoTest();
> t = null;
> AppDomain.Unload(ad);
> }
> }
>
> Output:
>
> DoTest()
>
> Unhandled Exception: System.NullReferenceException: Object reference not
> set to
> an instance of an object
>
> ** (AppDomainTest.exe:5828): WARNING **: : error looking up thread
> handle 0x84c91c4
>
> ** (AppDomainTest.exe:5828): WARNING **: Aborting of threads in domain
> Test timed out.
>
> Unhandled Exception: System.CannotUnloadAppDomainException: Aborting of
> threads
> in domain Test timed out.
> in (unmanaged) /usr/lib/libmono.so.0(mono_raise_exception+0x20)
> [0x400c3ad8]
> in (unmanaged) /usr/lib/libmono.so.0 [0x400ec901]
> in (unmanaged) /usr/lib/libmono.so.0 [0x400ec19f]
> in [0x00017] (at /cvs/mcs/class/corlib/System/AppDomain.cs:635)
> System.AppDomain:Unload (System.AppDomain)
> in [0x0002a] (at
> /root/.local/share/MonoDevelopProjects/AppDomainTest/Main.cs:21)
> MainClass:Main (string[])
>
>
>
> Is this a serious bug or am i missing something?
>
> The second (not so big) problem is the setting of private paths for the
> AppDomain. I use AppDomainSetup.PrivateBinPath property to set the value
> before i create the domain. It works fine, when using single search
> path, but when i try to use semicolon separated list of paths, AppDomain
> treats this as single path instead of parsing this string to get the
> list.
>
> see the documentation from MS:
>
http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemappdomainsetupclassprivatebinpathtopic.asp
>
> The workaround is to create the appdomain and then use the
> AppendPrivatePath method.
>
> Robert
>
> _______________________________________________
> Mono-list maillist  -  Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>