NO_THREAD_ABORT=1
NO_THREAD_SUSPEND_RESUME=1
+NO_MULTIPLE_APPDOMAINS=1
NO_PROCESS_START=1
NO_THREAD_ABORT=1
NO_THREAD_SUSPEND_RESUME=1
+NO_MULTIPLE_APPDOMAINS=1
NO_PROCESS_START=1
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)
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 =
namespace System.Runtime.Hosting {
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
[ComVisible (true)]
[MonoTODO ("missing manifest support")]
public class ApplicationActivator {
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
}
public abstract void EnsureState ();
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
public bool IsStateAvailable ()
{
AppDomainManager adm = AppDomain.CurrentDomain.DomainManager;
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
}
}
return _process_guid;
}
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
public static AppDomain CreateDomain (string friendlyName)
{
return CreateDomain (friendlyName, null, null);
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]
}
#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)
{
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 ();
return info;
}
+#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
[MethodImplAttribute (MethodImplOptions.InternalCall)]
private static extern bool InternalIsFinalizingForUnload (int domain_id);
return Thread.GetDomainID ();
}
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
[SecurityPermission (SecurityAction.Demand, ControlAppDomain = true)]
[ReliabilityContractAttribute (Consistency.MayCorruptAppDomain, Cer.MayFail)]
public static void Unload (AppDomain domain)
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)]
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);
[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)]
#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;
// 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)
{
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)
{
//
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);
}
namespace System {
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
[ComVisible (true)]
[SecurityPermission (SecurityAction.LinkDemand, Infrastructure = true)]
[SecurityPermission (SecurityAction.InheritanceDemand, Infrastructure = true)]
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
}
namespace System {
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
[ComVisible (true)]
public class AppDomainManager {
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
set { _activationArguments = value; }
}
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
[MonoLimitation ("it needs to be invoked within the created domain")]
public AppDomainInitializer AppDomainInitializer {
get {
}
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 {
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;
}
}
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
[Test]
public void Defaults ()
{
ContreteSecurityState ss = new ContreteSecurityState ();
Assert.IsFalse (ss.IsStateAvailable (), "IsStateAvailable");
}
+#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
}
}
}
}
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
[Test]
public void CurrentThread_Domains ()
{
Assert.IsTrue (o.Run ());
AppDomain.Unload (ad);
}
+#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
void CheckIsRunning (string s, Thread t)
{
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
+
using NUnit.Framework;
using System;
}
}
}
+
+#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
using System;
using System.Security;
}
}
+#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
}
}
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
[Test]
#if MOBILE
[Category ("NotWorking")]
Assert.IsNotNull (data);
Assert.IsTrue ((bool) data);
}
+#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
static void AppDomainInitialized1 (string [] args)
{
{
}
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
[Test]
#if MOBILE
[Category ("NotWorking")]
s.AppDomainInitializer = InstanceInitializer;
AppDomain.CreateDomain ("MyDomain", null, s);
}
+#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
}
}