[Mono-dev] AppDomains

Matthijs ter Woord matthijsterwoord at gmail.com
Tue Nov 14 08:26:01 EST 2006


I worked around this issue now in the project. This part works nicely now.




"Robert Jordan" <robertj at gmx.net> wrote in message 
news:ejc9jq$uqr$1 at sea.gmane.org...
> Matthijs ter Woord wrote:
>> I made a testcase, see attached file. The following output is expected:
>>
>> Foo
>> DoTest, 'Hello, World', True
>> done
>>
>
> Under MS.NET 1.1 I got the same self-explanatory exception
> like in Mono, so it seems that the serialization of delegates
> constructed from non-public static methods has changed in
> MS.NET 2.0.
>
> If the method is public, the test case works under Mono and
> MS.NET 1.1. If it's non public, it works only under MS.NET 2.0.
>
> Robert
>


--------------------------------------------------------------------------------


> using System;
> using System.Runtime.Serialization;
> using System.Reflection;
>
> public delegate void TestFixtureRunFinishedDelegate(string testRunName, 
> bool passed);
>
> public class MainClass
> {
>        public static void DoTest(string testRunName, bool passed)
>        {
>                Console.WriteLine("DoTest, '{0}', {1}", testRunName, 
> passed);
>        }
>
>        public static void Main()
>        {
>                AppDomain appDomain = AppDomain.CreateDomain ("Foo");
>                appDomain.SetData("TheMethod", new 
> TestFixtureRunFinishedDelegate(DoTest));
>                appDomain.DoCallBack (new CrossAppDomainDelegate 
> (CallBack));
>                Console.WriteLine ("done");
>        }
>
>        public static void CallBack ()
>        {
>                Console.WriteLine (AppDomain.CurrentDomain.FriendlyName);
>                (AppDomain.CurrentDomain.GetData("TheMethod") as 
> TestFixtureRunFinishedDelegate)("Hello, World", true);
>        }
> }
>


--------------------------------------------------------------------------------


> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
> 






More information about the Mono-devel-list mailing list