[Mono-bugs] [Bug 58707][Maj] Changed - Exception when trying to AppDomain.Unload()

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 21 May 2004 08:30:30 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by robik@mailbox.sk.

http://bugzilla.ximian.com/show_bug.cgi?id=58707

--- shadow/58707	2004-05-21 07:58:15.000000000 -0400
+++ shadow/58707.tmp.31309	2004-05-21 08:30:30.000000000 -0400
@@ -97,6 +97,61 @@
 
 ------- Additional Comments From massi@ximian.com  2004-05-21 07:54 -------
 This works for me with current cvs...
 
 ------- Additional Comments From robik@mailbox.sk  2004-05-21 07:58 -------
 I've just updated from CVS, and it seems to works now :) great
+
+------- Additional Comments From robik@mailbox.sk  2004-05-21 08:30 -------
+Well, tested a little bit more and now i have found another bug.
+
+Test this:
+
+using System;
+
+namespace AppDomainTest
+{
+	class AppDomainTest : MarshalByRefObject
+	{
+		static void Main()
+		{
+			Console.WriteLine("AppDomainTest:Main() Entered");
+			AppDomain ad1 = AppDomain.CreateDomain("Test 1");
+			AppDomainTest adt1 =
+(AppDomainTest)ad1.CreateInstanceAndUnwrap("AppDomainTest",
+"AppDomainTest.AppDomainTest");
+			adt1.DoTest();
+			AppDomain.Unload(ad1);
+			AppDomain ad2 = AppDomain.CreateDomain("Test 2");
+			AppDomainTest adt2 =
+(AppDomainTest)ad2.CreateInstanceAndUnwrap("AppDomainTest",
+"AppDomainTest.AppDomainTest");
+			adt2.DoTest();
+			AppDomain.Unload(ad2);
+			Console.WriteLine("AppDomainTest:Main() Exited");
+		}
+		void DoTest()
+		{
+			Console.WriteLine("AppDomainTest:DoTest()");
+		}
+	}
+}
+
+Result:
+
+AppDomainTest:Main() Entered.
+AppDomainTest:DoTest()
+Unhandled Exception: System.NullReferenceException: Object reference
+not set to an instance of an object
+in (unmanaged) (wrapper managed-to-native)
+System.Reflection.MonoMethod:InternalInvoke (object,object[])
+in <0x00004> (wrapper managed-to-native)
+System.Reflection.MonoMethod:InternalInvoke (object,object[])
+in <0x00073> System.AppDomain:InvokeInDomain
+(System.AppDomain,System.Reflection.MethodInfo,object,object[])
+in <0x00071> System.Runtime.Remoting.RemotingServices:GetDomainProxy
+(System.AppDomain)
+in <0x00079> System.AppDomain:CreateDomain
+(string,System.Security.Policy.Evidence,System.AppDomainSetup)
+in <0x0004c> System.AppDomain:CreateDomain (string)
+in <0x0012c> AppDomainTest.AppDomainTest:Main ()
+