[corlib] Remove multiple appdomain support (AppDomain.CreateDomain, etc) from tvOS...
authorRolf Bjarne Kvinge <rolf@xamarin.com>
Wed, 16 Dec 2015 18:20:33 +0000 (19:20 +0100)
committerRolf Bjarne Kvinge <rolf@xamarin.com>
Thu, 7 Jan 2016 12:04:27 +0000 (13:04 +0100)
16 files changed:
mcs/build/profiles/monotouch_tv.make
mcs/build/profiles/monotouch_watch.make
mcs/class/System.ServiceModel.Internals/Makefile
mcs/class/corlib/Makefile
mcs/class/corlib/System.Runtime.Hosting/ApplicationActivator.cs
mcs/class/corlib/System.Security/SecurityState.cs
mcs/class/corlib/System/AppDomain.cs
mcs/class/corlib/System/AppDomainInitializer.cs
mcs/class/corlib/System/AppDomainManager.cs
mcs/class/corlib/System/AppDomainManager_2_1.cs
mcs/class/corlib/System/AppDomainSetup.cs
mcs/class/corlib/Test/System.Security/SecurityStateTest.cs
mcs/class/corlib/Test/System.Threading/ThreadTest.cs
mcs/class/corlib/Test/System/AppDomainCas.cs
mcs/class/corlib/Test/System/AppDomainManagerTest.cs
mcs/class/corlib/Test/System/AppDomainSetupTest.cs

index 2a36da9c2032ce1918ab7042c33d0a42731096e9..a375281243adff5dcea255507337a9b146136a53 100644 (file)
@@ -5,4 +5,5 @@ PROFILE_MCS_FLAGS += \
 
 NO_THREAD_ABORT=1
 NO_THREAD_SUSPEND_RESUME=1
+NO_MULTIPLE_APPDOMAINS=1
 NO_PROCESS_START=1
index 8534aaf1f7750a334d83bb265da4b26af1e22def..0242c20bf515ca05121382763c7a25f3d1d9e86d 100644 (file)
@@ -5,4 +5,5 @@ PROFILE_MCS_FLAGS += \
 
 NO_THREAD_ABORT=1
 NO_THREAD_SUSPEND_RESUME=1
+NO_MULTIPLE_APPDOMAINS=1
 NO_PROCESS_START=1
index 24b5d2fc2e9b93f44c0ac70a9941155b47d5602d..2ddf10ebd269eafc2092c019941711ced109319e 100644 (file)
@@ -2,12 +2,16 @@ thisdir = class/System.ServiceModel.Internals
 SUBDIRS = 
 include ../../build/rules.make
 
+ifndef NO_MULTIPLE_APPDOMAINS
+REFERENCE_SOURCES_FLAGS += -d:MONO_FEATURE_MULTIPLE_APPDOMAINS
+endif
+
 LIBRARY = System.ServiceModel.Internals.dll
 LIB_REFS = System System.Core System.Xml
 ifneq (2.1, $(FRAMEWORK_VERSION))
        LIB_REFS += System.Configuration
 endif
-LIB_MCS_FLAGS = /unsafe
+LIB_MCS_FLAGS = /unsafe $(REFERENCE_SOURCES_FLAGS)
 
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
 
index 1162bf54f786093cca6184fc168e7324459f3c18..ef5490a16611d24189933d8678826a89e6a1f731 100644 (file)
@@ -51,6 +51,11 @@ REFERENCE_SOURCES_FLAGS += -d:MONO_FEATURE_THREAD_SUSPEND_RESUME
 TEST_MCS_FLAGS += -d:MONO_FEATURE_THREAD_SUSPEND_RESUME
 endif
 
+ifndef NO_MULTIPLE_APPDOMAINS
+REFERENCE_SOURCES_FLAGS += -d:MONO_FEATURE_MULTIPLE_APPDOMAINS
+TEST_MCS_FLAGS += -d:MONO_FEATURE_MULTIPLE_APPDOMAINS
+endif
+
 WARNING_ABOUT_DISABLED_WARNING=1635
 LOCAL_MCS_FLAGS = -unsafe -nostdlib -nowarn:612,618,$(WARNING_ABOUT_DISABLED_WARNING) -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC $(REFERENCE_SOURCES_FLAGS)
 DEFAULT_REFERENCES =
index 877d9a7e7eeea665ae4f66152fc26c9b3c1fdd08..bb3ed48bced514622cfa2b0d7d33f1e6d653c0c0 100644 (file)
@@ -33,6 +33,7 @@ using System.Security.Policy;
 
 namespace System.Runtime.Hosting {
 
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
        [ComVisible (true)]
        [MonoTODO ("missing manifest support")]
        public class ApplicationActivator {
@@ -91,5 +92,30 @@ namespace System.Runtime.Hosting {
                        return ad.CreateInstance ("assemblyName", "typeName", null);
                }
        }
+#else
+       [Obsolete ("ApplicationActivator is not supported on this platform.", true)]
+       public class ApplicationActivator {
+
+               public ApplicationActivator ()
+               {
+                       throw new PlatformNotSupportedException ("ApplicationActivator is not supported on this platform.");
+               }
+
+               public virtual ObjectHandle CreateInstance (ActivationContext activationContext)
+               {
+                       throw new PlatformNotSupportedException ("ApplicationActivator is not supported on this platform.");
+               }
+
+               public virtual ObjectHandle CreateInstance (ActivationContext activationContext, string[] activationCustomData)
+               {
+                       throw new PlatformNotSupportedException ("ApplicationActivator is not supported on this platform.");
+               }
+
+               protected static ObjectHandle CreateInstanceHelper (AppDomainSetup adSetup)
+               {
+                       throw new PlatformNotSupportedException ("ApplicationActivator is not supported on this platform.");
+               }
+       }
+#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
 }
 
index 812aa8087ab2b076526e3a070eaec03eae4f3dee..19a36f961a5960b1ca6ca3b4c539c34b461b8736 100644 (file)
@@ -37,6 +37,7 @@ namespace System.Security {
 
                public abstract void EnsureState ();
 
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
                public bool IsStateAvailable ()
                {
                        AppDomainManager adm = AppDomain.CurrentDomain.DomainManager;
@@ -44,6 +45,13 @@ namespace System.Security {
                                return false;
                        return adm.CheckSecuritySettings (this);
                }
+#else
+               [Obsolete ("SecurityState.IsStateAvailable is not supported on this platform.", true)]
+               public bool IsStateAvailable ()
+               {
+                       throw new PlatformNotSupportedException ("SecurityState.IsStateAvailable is not supported on this platform.");
+               }
+#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
        }
 }
 
index 22927ecd2f5d668eb44da7da7a933fb180d3983f..13cc078e575b0b757017347382bd9d393214a78d 100644 (file)
@@ -983,6 +983,7 @@ namespace System {
                        return _process_guid;
                }
 
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
                public static AppDomain CreateDomain (string friendlyName)
                {
                        return CreateDomain (friendlyName, null, null);
@@ -1061,6 +1062,25 @@ namespace System {
 
                        return ad;
                }
+#else
+               [Obsolete ("AppDomain.CreateDomain is not supported on the current platform.", true)]
+               public static AppDomain CreateDomain (string friendlyName)
+               {
+                       throw new PlatformNotSupportedException ("AppDomain.CreateDomain is not supported on the current platform.");
+               }
+               
+               [Obsolete ("AppDomain.CreateDomain is not supported on the current platform.", true)]
+               public static AppDomain CreateDomain (string friendlyName, Evidence securityInfo)
+               {
+                       throw new PlatformNotSupportedException ("AppDomain.CreateDomain is not supported on the current platform.");
+               }
+
+               [Obsolete ("AppDomain.CreateDomain is not supported on the current platform.", true)]
+               public static AppDomain CreateDomain (string friendlyName, Evidence securityInfo, AppDomainSetup info)
+               {
+                       throw new PlatformNotSupportedException ("AppDomain.CreateDomain is not supported on the current platform.");
+               }
+#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
 
 #if !NET_2_1
                [Serializable]
@@ -1098,13 +1118,23 @@ namespace System {
                }
 #endif
 
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
                public static AppDomain CreateDomain (string friendlyName, Evidence securityInfo,string appBasePath,
                                                      string appRelativeSearchPath, bool shadowCopyFiles)
                {
                        return CreateDomain (friendlyName, securityInfo, CreateDomainSetup (appBasePath, appRelativeSearchPath, shadowCopyFiles));
                }
+#else
+               [Obsolete ("AppDomain.CreateDomain is not supported on the current platform.", true)]
+               public static AppDomain CreateDomain (string friendlyName, Evidence securityInfo,string appBasePath,
+                                                     string appRelativeSearchPath, bool shadowCopyFiles)
+               {
+                       throw new PlatformNotSupportedException ("AppDomain.CreateDomain is not supported on the current platform.");
+               }
+#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
                
 #if !NET_2_1
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
                public static AppDomain CreateDomain (string friendlyName, Evidence securityInfo, AppDomainSetup info,
                                                      PermissionSet grantSet, params StrongName [] fullTrustAssemblies)
                {
@@ -1114,8 +1144,17 @@ namespace System {
                        info.ApplicationTrust = new ApplicationTrust (grantSet, fullTrustAssemblies ?? EmptyArray<StrongName>.Value);
                        return CreateDomain (friendlyName, securityInfo, info);         
                }
+#else
+               [Obsolete ("AppDomain.CreateDomain is not supported on the current platform.", true)]
+               public static AppDomain CreateDomain (string friendlyName, Evidence securityInfo, AppDomainSetup info,
+                                                     PermissionSet grantSet, params StrongName [] fullTrustAssemblies)
+               {
+                       throw new PlatformNotSupportedException ("AppDomain.CreateDomain is not supported on the current platform.");
+               }
+#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
 #endif
 
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
                static AppDomainSetup CreateDomainSetup (string appBasePath, string appRelativeSearchPath, bool shadowCopyFiles)
                {
                        AppDomainSetup info = new AppDomainSetup ();
@@ -1130,6 +1169,7 @@ namespace System {
 
                        return info;
                }
+#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
                
                [MethodImplAttribute (MethodImplOptions.InternalCall)]
                private static extern bool InternalIsFinalizingForUnload (int domain_id);
@@ -1149,6 +1189,7 @@ namespace System {
                        return Thread.GetDomainID ();
                }
 
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
                [SecurityPermission (SecurityAction.Demand, ControlAppDomain = true)]
                [ReliabilityContractAttribute (Consistency.MayCorruptAppDomain, Cer.MayFail)]
                public static void Unload (AppDomain domain)
@@ -1158,6 +1199,13 @@ namespace System {
 
                        InternalUnload (domain.getDomainID());
                }
+#else
+               [Obsolete ("AppDomain.Unload is not supported on the current platform.", true)]
+               public static void Unload (AppDomain domain)
+               {
+                       throw new PlatformNotSupportedException ("AppDomain.Unload is not supported on the current platform.");
+               }
+#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
 
                [MethodImplAttribute (MethodImplOptions.InternalCall)]
                [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
@@ -1339,11 +1387,13 @@ namespace System {
                        return null;
                }
 
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
                private void DoDomainUnload ()
                {
                        if (DomainUnload != null)
                                DomainUnload(this, null);
                }
+#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
 
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
                internal extern void DoUnhandledException (Exception e);
@@ -1389,7 +1439,11 @@ namespace System {
                [method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
                public event ResolveEventHandler AssemblyResolve;
 
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
                [method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
+#else
+               [Obsolete ("AppDomain.DomainUnload is not supported on the current platform.", true)]
+#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
                public event EventHandler DomainUnload;
 
                [method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
@@ -1424,10 +1478,17 @@ namespace System {
 #endif
         #pragma warning restore 649
 
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
                // default is null
                public AppDomainManager DomainManager {
                        get { return (AppDomainManager)_domain_manager; }
                }
+#else
+               [Obsolete ("AppDomain.DomainManager is not supported on this platform.", true)]
+               public AppDomainManager DomainManager {
+                       get { throw new PlatformNotSupportedException ("AppDomain.DomainManager is not supported on this platform."); }
+               }
+#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
 
 #if !MOBILE
                public event ResolveEventHandler ReflectionOnlyAssemblyResolve;
@@ -1473,6 +1534,7 @@ namespace System {
 
                // static methods
 
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
                public static AppDomain CreateDomain (string friendlyName, Evidence securityInfo, string appBasePath,
                        string appRelativeSearchPath, bool shadowCopyFiles, AppDomainInitializer adInit, string[] adInitArgs)
                {
@@ -1483,6 +1545,14 @@ namespace System {
 
                        return CreateDomain (friendlyName, securityInfo, info);
                }
+#else
+               [Obsolete ("AppDomain.CreateDomain is not supported on the current platform.", true)]
+               public static AppDomain CreateDomain (string friendlyName, Evidence securityInfo, string appBasePath,
+                       string appRelativeSearchPath, bool shadowCopyFiles, AppDomainInitializer adInit, string[] adInitArgs)
+               {
+                       throw new PlatformNotSupportedException ("AppDomain.CreateDomain is not supported on the current platform.");
+               }
+#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
 
                public int ExecuteAssemblyByName (string assemblyName)
                {
index 25700d49e5cb58fa41b3d9e0a541d110a438cb50..c50f40da3736298e6817ce0c06d90190d20b2483 100644 (file)
 //
 
 namespace System {
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
        [System.Runtime.InteropServices.ComVisible (true)]
        [Serializable]
+#else
+       [Obsolete ("AppDomainInitializer is not supported on the current platform.", true)]
+#endif
        public delegate void AppDomainInitializer (string[] args);
 
 }
index f0a4770b71ec9157bf31b1d5eb1a65c02f02856a..301fd334c70ef1c2c3aaf5aeb8f4725eaae2e79e 100644 (file)
@@ -36,6 +36,7 @@ using System.Threading;
 
 namespace System {
 
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
        [ComVisible (true)]
        [SecurityPermission (SecurityAction.LinkDemand, Infrastructure = true)]
        [SecurityPermission (SecurityAction.InheritanceDemand, Infrastructure = true)]
@@ -111,4 +112,55 @@ namespace System {
                        return AppDomain.CreateDomain (friendlyName, securityInfo, appDomainInfo);
                }
        }
+#else
+       [Obsolete ("AppDomainManager is not supported on the current platform.", true)]
+       public class AppDomainManager : MarshalByRefObject {
+               public AppDomainManager ()
+               {
+                       throw new PlatformNotSupportedException ("AppDomainManager is not supported on the current platform.");
+               }
+
+               public virtual ApplicationActivator ApplicationActivator {
+                       get { throw new PlatformNotSupportedException ("AppDomainManager is not supported on the current platform."); }
+               }
+
+               public virtual Assembly EntryAssembly {
+                       get { throw new PlatformNotSupportedException ("AppDomainManager is not supported on the current platform."); }
+               }
+
+               public virtual HostExecutionContextManager HostExecutionContextManager {
+                       get { throw new PlatformNotSupportedException ("AppDomainManager is not supported on the current platform."); }
+               }
+
+               public virtual HostSecurityManager HostSecurityManager {
+                       get { throw new PlatformNotSupportedException ("AppDomainManager is not supported on the current platform."); }
+               }
+
+               public AppDomainManagerInitializationOptions InitializationFlags {
+                       get { throw new PlatformNotSupportedException ("AppDomainManager is not supported on the current platform."); }
+                       set { throw new PlatformNotSupportedException ("AppDomainManager is not supported on the current platform."); }
+               }
+
+               public virtual AppDomain CreateDomain (string friendlyName, Evidence securityInfo, AppDomainSetup appDomainInfo)
+               {
+                       throw new PlatformNotSupportedException ("AppDomainManager is not supported on the current platform.");
+               }
+
+               public virtual void InitializeNewDomain (AppDomainSetup appDomainInfo)
+               {
+                       throw new PlatformNotSupportedException ("AppDomainManager is not supported on the current platform.");
+               }
+
+               public virtual bool CheckSecuritySettings (SecurityState state)
+               {
+                       throw new PlatformNotSupportedException ("AppDomainManager is not supported on the current platform.");
+               }
+
+               protected static AppDomain CreateDomainHelper (string friendlyName, Evidence securityInfo, AppDomainSetup appDomainInfo)
+               {
+                       throw new PlatformNotSupportedException ("AppDomainManager is not supported on the current platform.");
+               }
+       }
+
+#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
 }
index 572dcae8d2b32b187c79653adf1656292a5aa228..cc45ffd33dec20d26d79f32370a71229609cfe71 100644 (file)
@@ -33,6 +33,7 @@ using System.Security;
 
 namespace System {
 
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
        [ComVisible (true)]
        public class AppDomainManager {
 
@@ -51,6 +52,26 @@ namespace System {
                        return (state != null);
                }
        }
+#else
+       [Obsolete ("AppDomainManager is not supported on the current platform.", true)]
+       public class AppDomainManager {
+
+               public AppDomainManager ()
+               {
+                       get { throw new PlatformNotSupportedException ("AppDomainManager is not supported on the current platform."); }
+               }
+
+               public virtual void InitializeNewDomain (AppDomainSetup appDomainInfo)
+               {
+                       get { throw new PlatformNotSupportedException ("AppDomainManager is not supported on the current platform."); }
+               }
+
+               public virtual bool CheckSecuritySettings (SecurityState state)
+               {
+                       get { throw new PlatformNotSupportedException ("AppDomainManager is not supported on the current platform."); }
+               }
+       }
+#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
 }
 
 #endif
index d689f379ff24bb7999ef081b05b7efbd9d8160a8..b3e2d510138af5bcc9b4fafc390304de7cd1a159 100644 (file)
@@ -309,6 +309,7 @@ namespace System
                        set { _activationArguments = value; }
                }
 
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
                [MonoLimitation ("it needs to be invoked within the created domain")]
                public AppDomainInitializer AppDomainInitializer {
                        get {
@@ -319,6 +320,14 @@ namespace System
                        }
                        set { domain_initializer = value; }
                }
+#else
+               [Obsolete ("AppDomainSetup.AppDomainInitializer is not supported on this platform.", true)]
+               public AppDomainInitializer AppDomainInitializer {
+                       get { throw new PlatformNotSupportedException ("AppDomainSetup.AppDomainInitializer is not supported on this platform."); }
+                       set { throw new PlatformNotSupportedException ("AppDomainSetup.AppDomainInitializer is not supported on this platform."); }
+               }
+#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
+
 
                [MonoLimitation ("it needs to be used to invoke the initializer within the created domain")]
                public string [] AppDomainInitializerArguments {
@@ -369,7 +378,9 @@ namespace System
                                object [] arr = (object []) bf.Deserialize (ms);
 
                                _activationArguments = (ActivationArguments) arr [0];
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
                                domain_initializer = (AppDomainInitializer) arr [1];
+#endif
                                application_trust = (ApplicationTrust) arr [2];
 
                                serialized_non_primitives = null;
index 7744e7ccb7ca4410b9f44770e1f984339d8c4ad1..86b3a1dbad25c7497d8c5b44dbc94a08f3331c10 100644 (file)
@@ -44,12 +44,14 @@ namespace MonoTests.System.Security {
                        }
                }
 
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
                [Test]
                public void Defaults ()
                {
                        ContreteSecurityState ss = new ContreteSecurityState ();
                        Assert.IsFalse (ss.IsStateAvailable (), "IsStateAvailable");
                }
+#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
        }
 }
 
index b49fba552fa06750c132fa5a1eb7738475e391da..5773a1003f63821a3440ca8289347d5b6d6346c5 100644 (file)
@@ -964,6 +964,7 @@ namespace MonoTests.System.Threading
                        }
                }
 
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
                [Test]
                public void CurrentThread_Domains ()
                {
@@ -973,6 +974,7 @@ namespace MonoTests.System.Threading
                        Assert.IsTrue (o.Run ());
                        AppDomain.Unload (ad);
                }
+#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
 
                void CheckIsRunning (string s, Thread t)
                {
index 6d95120f8ae3eb7c6e5360813f136bf3f2cd9489..3516b040c389e7c5aa7f52224fb54f6fb400c1d4 100644 (file)
@@ -26,6 +26,8 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
+
 using NUnit.Framework;
 
 using System;
@@ -404,3 +406,5 @@ namespace MonoCasTests.System {
                }
        }
 }
+
+#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
index 83d198ca50393b3f1180310eb7068d085030d46d..f90a9eccc61717737d4669243c8fb99f27152c76 100644 (file)
@@ -26,6 +26,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
 
 using System;
 using System.Security;
@@ -56,3 +57,4 @@ namespace MonoTests.System {
        }
 }
 
+#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
index 2e4b6e59a834022f2675183428d671ee5329e4eb..121d1c45f10a88ceae0f80fdbbfe3575d7f7cb70 100644 (file)
@@ -169,6 +169,7 @@ namespace MonoTests.System
                        }
                }
 
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
                [Test]
 #if MOBILE
                [Category ("NotWorking")]
@@ -184,6 +185,7 @@ namespace MonoTests.System
                        Assert.IsNotNull (data);
                        Assert.IsTrue ((bool) data);
                }
+#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
 
                static void AppDomainInitialized1 (string [] args)
                {
@@ -199,6 +201,7 @@ namespace MonoTests.System
                {
                }
 
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
                [Test]
 #if MOBILE
                [Category ("NotWorking")]
@@ -211,5 +214,6 @@ namespace MonoTests.System
                        s.AppDomainInitializer = InstanceInitializer;
                        AppDomain.CreateDomain ("MyDomain", null, s);
                }
+#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
        }
 }