}
#endif
+ internal ObjectHandle InternalCreateInstanceWithNoSecurity (string assemblyName, string typeName)
+ {
+ return CreateInstance(assemblyName, typeName);
+ }
+
+ internal ObjectHandle InternalCreateInstanceWithNoSecurity (string assemblyName,
+ string typeName,
+ bool ignoreCase,
+ BindingFlags bindingAttr,
+ Binder binder,
+ Object[] args,
+ CultureInfo culture,
+ Object[] activationAttributes,
+ Evidence securityAttributes)
+ {
+#pragma warning disable 618
+ return CreateInstance(assemblyName, typeName, ignoreCase, bindingAttr, binder, args, culture, activationAttributes, securityAttributes);
+#pragma warning restore 618
+ }
+
+ internal ObjectHandle InternalCreateInstanceFromWithNoSecurity (string assemblyName, string typeName)
+ {
+ return CreateInstanceFrom(assemblyName, typeName);
+ }
+
+ internal ObjectHandle InternalCreateInstanceFromWithNoSecurity (string assemblyName,
+ string typeName,
+ bool ignoreCase,
+ BindingFlags bindingAttr,
+ Binder binder,
+ Object[] args,
+ CultureInfo culture,
+ Object[] activationAttributes,
+ Evidence securityAttributes)
+ {
+#pragma warning disable 618
+ return CreateInstanceFrom(assemblyName, typeName, ignoreCase, bindingAttr, binder, args, culture, activationAttributes, securityAttributes);
+#pragma warning restore 618
+ }
+
public ObjectHandle CreateInstance (string assemblyName, string typeName)
{
if (assemblyName == null)
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);
internal void DoUnhandledException (UnhandledExceptionEventArgs args) {
if (UnhandledException != null)
[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)
{