20 [__DynamicallyInvokable]
23 internal const int LookupMask = 255;
59 return CreateInstance(type, bindingAttr, binder, args, culture,
null);
89 [SecuritySafeCritical]
92 if ((
object)type ==
null)
104 if (activationAttributes !=
null && activationAttributes.Length != 0)
116 if (runtimeType ==
null)
120 StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
121 return runtimeType.CreateInstanceImpl(bindingAttr, binder, args, culture, activationAttributes, ref stackMark);
147 [__DynamicallyInvokable]
203 [__DynamicallyInvokable]
229 [SecuritySafeCritical]
232 StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
259 [SecuritySafeCritical]
262 StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
291 if ((
object)type ==
null)
296 if (runtimeType ==
null)
300 StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
301 return runtimeType.CreateInstanceDefaultCtor(!nonPublic, skipCheckThis:
false, fillCache:
true, ref stackMark);
310 [__DynamicallyInvokable]
313 RuntimeType runtimeType = typeof(
T) as RuntimeType;
314 if (runtimeType.HasElementType)
318 StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
319 return (
T)runtimeType.CreateInstanceDefaultCtor(publicOnly:
true, skipCheckThis:
true, fillCache:
true, ref stackMark);
398 [SecuritySafeCritical]
399 [Obsolete(
"Methods which use evidence to sandbox are obsolete and will be removed in a future release of the .NET Framework. Please use an overload of CreateInstance which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
402 StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
403 return CreateInstance(assemblyName, typeName, ignoreCase, bindingAttr, binder, args, culture, activationAttributes, securityInfo, ref stackMark);
434 [SecuritySafeCritical]
437 StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
438 return CreateInstance(assemblyName, typeName, ignoreCase, bindingAttr, binder, args, culture, activationAttributes,
null, ref stackMark);
450 if (assemblyString ==
null)
456 RuntimeAssembly assemblyFromResolveEvent;
457 AssemblyName assemblyName = RuntimeAssembly.CreateAssemblyName(assemblyString, forIntrospection:
false, out assemblyFromResolveEvent);
458 if (assemblyFromResolveEvent !=
null)
460 assembly = assemblyFromResolveEvent;
464 type =
Type.GetType(typeName +
", " + assemblyString, throwOnError:
true, ignoreCase);
468 assembly = RuntimeAssembly.InternalLoadAssemblyName(assemblyName, securityInfo,
null, ref stackMark, throwOnFileNotFound:
true, forIntrospection:
false, suppressSecurityChecks:
false);
473 if (assembly ==
null)
477 type = assembly.GetType(typeName, throwOnError:
true, ignoreCase);
479 object obj =
CreateInstance(type, bindingAttr, binder, args, culture, activationAttributes);
514 [Obsolete(
"Methods which use evidence to sandbox are obsolete and will be removed in a future release of the .NET Framework. Please use an overload of CreateInstanceFrom which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
521 return CreateInstanceFromInternal(assemblyFile, typeName, ignoreCase, bindingAttr, binder, args, culture, activationAttributes, securityInfo);
552 return CreateInstanceFromInternal(assemblyFile, typeName, ignoreCase, bindingAttr, binder, args, culture, activationAttributes,
null);
558 Type type = assembly.GetType(typeName, throwOnError:
true, ignoreCase);
559 object obj =
CreateInstance(type, bindingAttr, binder, args, culture, activationAttributes);
594 return domain.InternalCreateInstanceWithNoSecurity(assemblyName, typeName);
627 [Obsolete(
"Methods which use evidence to sandbox are obsolete and will be removed in a future release of the .NET Framework. Please use an overload of CreateInstance which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
638 return domain.InternalCreateInstanceWithNoSecurity(assemblyName, typeName, ignoreCase, bindingAttr, binder, args, culture, activationAttributes, securityAttributes);
676 return domain.InternalCreateInstanceWithNoSecurity(assemblyName, typeName, ignoreCase, bindingAttr, binder, args, culture, activationAttributes,
null);
704 return domain.InternalCreateInstanceFromWithNoSecurity(assemblyFile, typeName);
736 [Obsolete(
"Methods which use Evidence to sandbox are obsolete and will be removed in a future release of the .NET Framework. Please use an overload of CreateInstanceFrom which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
747 return domain.InternalCreateInstanceFromWithNoSecurity(assemblyFile, typeName, ignoreCase, bindingAttr, binder, args, culture, activationAttributes, securityAttributes);
785 return domain.InternalCreateInstanceFromWithNoSecurity(assemblyFile, typeName, ignoreCase, bindingAttr, binder, args, culture, activationAttributes,
null);
791 [SecuritySafeCritical]
795 if (appDomainManager ==
null)
806 [SecuritySafeCritical]
810 if (appDomainManager ==
null)
814 return appDomainManager.
ApplicationActivator.CreateInstance(activationContext, activationCustomData);
863 Type type = assembly.GetType(typeName, throwOnError:
true, ignoreCase:
false);
869 if (assembly ==
null)
916 [Conditional(
"_DEBUG")]
917 private static void Log(
bool test,
string title,
string success,
string failure)
926 throw new NotImplementedException();
936 throw new NotImplementedException();
948 throw new NotImplementedException();
961 void _Activator.
Invoke(uint dispIdMember, [In] ref Guid riid, uint lcid,
short wFlags, IntPtr pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr)
963 throw new NotImplementedException();
static Assembly GetExecutingAssembly()
Gets the assembly that contains the code that is currently executing.
static object CreateInstance(Type type)
Creates an instance of the specified type using that type's default constructor.
AssemblyContentType
Provides information about the type of code contained in an assembly.
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
virtual ApplicationActivator ApplicationActivator
Gets the application activator that handles the activation of add-ins and manifest-based applications...
static ObjectHandle CreateComInstanceFrom(string assemblyName, string typeName)
Creates an instance of the COM object whose name is specified, using the named assembly file and the ...
The exception that is thrown when there is an attempt to dynamically access a method that does not ex...
static ObjectHandle CreateInstanceFrom(string assemblyFile, string typeName)
Creates an instance of the type whose name is specified, using the named assembly file and default co...
static ObjectHandle CreateInstance(ActivationContext activationContext)
Creates an instance of the type designated by the specified T:System.ActivationContext object.
static ObjectHandle CreateInstance(string assemblyName, string typeName, bool ignoreCase, BindingFlags bindingAttr, Binder binder, object[] args, CultureInfo culture, object[] activationAttributes, Evidence securityInfo)
Creates an instance of the type whose name is specified, using the named assembly and the constructor...
static ObjectHandle CreateInstance(string assemblyName, string typeName, bool ignoreCase, BindingFlags bindingAttr, Binder binder, object[] args, CultureInfo culture, object[] activationAttributes)
Creates an instance of the type whose name is specified, using the named assembly and the constructor...
Identifies the activation context for the current application. This class cannot be inherited.
static ObjectHandle CreateInstance(AppDomain domain, string assemblyName, string typeName)
Creates an instance of the type whose name is specified in the specified remote domain,...
BindingFlags
Specifies flags that control binding and the way in which the search for members and types is conduct...
abstract object [] GetCustomAttributes(bool inherit)
When overridden in a derived class, returns an array of all custom attributes applied to this member.
AssemblyContentType ContentType
Gets or sets a value that indicates what type of content the assembly contains.
abstract Type UnderlyingSystemType
Indicates the type provided by the common language runtime that represents this type.
static object CreateInstance(Type type, object[] args, object[] activationAttributes)
Creates an instance of the specified type using the constructor that best matches the specified param...
static ObjectHandle CreateInstance(string assemblyName, string typeName)
Creates an instance of the type whose name is specified, using the named assembly and default constru...
void GetTypeInfoCount(out uint pcTInfo)
Retrieves the number of type information interfaces that an object provides (either 0 or 1).
static AppDomain CurrentDomain
Gets the current application domain for the current T:System.Threading.Thread.
Represents an application domain, which is an isolated environment where applications execute....
static T CreateInstance< T >()
Creates an instance of the type designated by the specified generic type parameter,...
static ObjectHandle CreateInstanceFrom(AppDomain domain, string assemblyFile, string typeName, bool ignoreCase, BindingFlags bindingAttr, Binder binder, object[] args, CultureInfo culture, object[] activationAttributes)
Creates an instance of the type whose name is specified in the specified remote domain,...
static ObjectHandle CreateInstanceFrom(string assemblyFile, string typeName, object[] activationAttributes)
Creates an instance of the type whose name is specified, using the named assembly file and default co...
static ObjectHandle CreateInstanceFrom(string assemblyFile, string typeName, bool ignoreCase, BindingFlags bindingAttr, Binder binder, object[] args, CultureInfo culture, object[] activationAttributes, Evidence securityInfo)
Creates an instance of the type whose name is specified, using the named assembly file and the constr...
Contains methods to create types of objects locally or remotely, or obtain references to existing rem...
static object CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, object[] args, CultureInfo culture, object[] activationAttributes)
Creates an instance of the specified type using the constructor that best matches the specified param...
Provides information about, and means to manipulate, the current environment and platform....
static object CreateInstance(Type type, bool nonPublic)
Creates an instance of the specified type using that type's default constructor.
The exception that is thrown when type-loading failures occur.
Defines and creates new instances of classes during run time.
void Invoke(uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr)
Provides access to properties and methods exposed by an object.
static ObjectHandle CreateInstanceFrom(AppDomain domain, string assemblyFile, string typeName, bool ignoreCase, BindingFlags bindingAttr, Binder binder, object[] args, CultureInfo culture, object[] activationAttributes, Evidence securityAttributes)
Creates an instance of the type whose name is specified in the specified remote domain,...
Represents an assembly, which is a reusable, versionable, and self-describing building block of a com...
Represents type declarations: class types, interface types, array types, value types,...
Wraps marshal-by-value object references, allowing them to be returned through an indirection.
static object Connect(Type classToProxy, string url)
Creates a proxy for a well-known object, given the T:System.Type and URL.
MethodImplOptions
Defines the details of how a method is implemented.
Exposes the T:System.Activator class to unmanaged code.
static ObjectHandle CreateInstance(AppDomain domain, string assemblyName, string typeName, bool ignoreCase, BindingFlags bindingAttr, Binder binder, object[] args, CultureInfo culture, object[] activationAttributes)
Creates an instance of the type whose name is specified in the specified remote domain,...
bool IsContextful
Gets a value indicating whether the T:System.Type can be hosted in a context.
Selects a member from a list of candidates, and performs type conversion from actual argument type to...
static Assembly LoadFrom(string assemblyFile)
Loads an assembly given its file name or path.
Provides a managed equivalent of an unmanaged host.
Describes an assembly's unique identity in full.
static ObjectHandle CreateInstanceFrom(string assemblyFile, string typeName, bool ignoreCase, BindingFlags bindingAttr, Binder binder, object[] args, CultureInfo culture, object[] activationAttributes)
Creates an instance of the type whose name is specified, using the named assembly file and the constr...
The exception that is thrown when one of the arguments provided to a method is not valid.
static ObjectHandle CreateInstanceFrom(AppDomain domain, string assemblyFile, string typeName)
Creates an instance of the type whose name is specified in the specified remote domain,...
static object CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, object[] args, CultureInfo culture)
Creates an instance of the specified type using the constructor that best matches the specified param...
static object GetObject(Type type, string url, object state)
Creates a proxy for the well-known object indicated by the specified type, URL, and channel data.
static ObjectHandle CreateInstance(AppDomain domain, string assemblyName, string typeName, bool ignoreCase, BindingFlags bindingAttr, Binder binder, object[] args, CultureInfo culture, object[] activationAttributes, Evidence securityAttributes)
Creates an instance of the type whose name is specified in the specified remote domain,...
Defines the set of information that constitutes input to security policy decisions....
void GetIDsOfNames([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)
Maps a set of names to a corresponding set of dispatch identifiers.
bool IsMarshalByRef
Gets a value indicating whether the T:System.Type is marshaled by reference.
AppDomainManager DomainManager
Gets the domain manager that was provided by the host when the application domain was initialized.
static object GetObject(Type type, string url)
Creates a proxy for the well-known object indicated by the specified type and URL.
void GetTypeInfo(uint iTInfo, uint lcid, IntPtr ppTInfo)
Retrieves the type information for an object, which can be used to get the type information for an in...
ClassInterfaceType
Identifies the type of class interface that is generated for a class.
Provides information about a specific culture (called a locale for unmanaged code development)....
The exception that is thrown when an invoked method is not supported, or when there is an attempt to ...
Provides several methods for using and publishing remoted objects and proxies. This class cannot be i...
static ObjectHandle CreateInstance(string assemblyName, string typeName, object[] activationAttributes)
Creates an instance of the type whose name is specified, using the named assembly and default constru...
Defines an attribute that can be used at the call site to specify the URL where the activation will h...
Controls accessibility of an individual managed type or member, or of all types within an assembly,...
AssemblyHashAlgorithm
Specifies all the hash algorithms used for hashing files and for generating the strong name.
static object CreateInstance(Type type, params object[] args)
Creates an instance of the specified type using the constructor that best matches the specified param...
static ObjectHandle CreateComInstanceFrom(string assemblyName, string typeName, byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm)
Creates an instance of the COM object whose name is specified, using the named assembly file and the ...
static ObjectHandle CreateInstance(ActivationContext activationContext, string[] activationCustomData)
Creates an instance of the type that is designated by the specified T:System.ActivationContext object...