Esempio n. 1
0
        public static ObjectHandle CreateInstance(AppDomain domain,
                                                  string assemblyName,
                                                  string typeName,
                                                  bool ignoreCase,
                                                  BindingFlags bindingAttr,
                                                  Binder binder,
                                                  object[] args,
                                                  CultureInfo culture,
                                                  object[] activationAttributes)
        {
            if (domain == null)
            {
                throw new ArgumentNullException(nameof(domain));
            }
            Contract.EndContractBlock();

            return(domain.InternalCreateInstanceWithNoSecurity(assemblyName,
                                                               typeName,
                                                               ignoreCase,
                                                               bindingAttr,
                                                               binder,
                                                               args,
                                                               culture,
                                                               activationAttributes,
                                                               null));
        }
Esempio n. 2
0
        public static ObjectHandle CreateInstance(AppDomain domain,
                                                  string assemblyName,
                                                  string typeName,
                                                  bool ignoreCase,
                                                  BindingFlags bindingAttr,
                                                  Binder binder,
                                                  Object[] args,
                                                  CultureInfo culture,
                                                  Object[] activationAttributes,
                                                  Evidence securityAttributes)
        {
            if (domain == null)
            {
                throw new ArgumentNullException("domain");
            }
            Contract.EndContractBlock();

#if FEATURE_CAS_POLICY
            if (securityAttributes != null && !AppDomain.CurrentDomain.IsLegacyCasPolicyEnabled)
            {
                throw new NotSupportedException(Environment.GetResourceString("NotSupported_RequiresCasPolicyImplicit"));
            }
#endif // FEATURE_CAS_POLICY

            return(domain.InternalCreateInstanceWithNoSecurity(assemblyName, typeName, ignoreCase, bindingAttr, binder, args, culture, activationAttributes, securityAttributes));
        }
Esempio n. 3
0
 public static ObjectHandle CreateInstance(AppDomain domain, string assemblyName, string typeName)
 {
     if (domain == null)
     {
         throw new ArgumentNullException("domain");
     }
     return(domain.InternalCreateInstanceWithNoSecurity(assemblyName, typeName));
 }
Esempio n. 4
0
        //
        // This API is designed to be used when a host needs to execute code in an AppDomain
        // with restricted security permissions. In that case, we demand in the client domain
        // and assert in the server domain because the server domain might not be trusted enough
        // to pass the security checks when activating the type.
        //

        public static ObjectHandle CreateInstance(AppDomain domain, string assemblyName, string typeName)
        {
            if (domain == null)
            {
                throw new ArgumentNullException(nameof(domain));
            }
            Contract.EndContractBlock();
            return(domain.InternalCreateInstanceWithNoSecurity(assemblyName, typeName));
        }
Esempio n. 5
0
 public static ObjectHandle CreateInstance(AppDomain domain,
                                           string assemblyName,
                                           string typeName,
                                           bool ignoreCase,
                                           BindingFlags bindingAttr,
                                           Binder binder,
                                           Object[] args,
                                           CultureInfo culture,
                                           Object[] activationAttributes,
                                           Evidence securityAttributes)
 {
     if (domain == null)
     {
         throw new ArgumentNullException("domain");
     }
     return(domain.InternalCreateInstanceWithNoSecurity(assemblyName, typeName, ignoreCase, bindingAttr, binder, args, culture, activationAttributes, securityAttributes));
 }