AppDomain.CreateComInstanceFrom Method (String, String, Byte, AssemblyHashAlgorithm)
Creates a new instance of a specified COM type. Parameters specify the name of a file that contains an assembly containing the type and the name of the type.
Assembly: mscorlib (in mscorlib.dll)
member CreateComInstanceFrom : assemblyFile:string * typeName:string * hashValue:byte * hashAlgorithm:AssemblyHashAlgorithm -> ObjectHandle
- Type: System.String
The name of a file containing an assembly that defines the requested type.
- Type: System.String
The name of the requested type.
- Type: System.Byte
Represents the value of the computed hash code.
- Type: System.Configuration.Assemblies.AssemblyHashAlgorithm
Represents the hash algorithm used by the assembly manifest.
Return ValueType: System.Runtime.Remoting.ObjectHandle
An object that is a wrapper for the new instance specified by typeName. The return value needs to be unwrapped to access the real object.
assemblyName or typeName is a null reference (Nothing in Visual Basic).
The type cannot be loaded.
The operation is attempted on an unloaded application domain.
No public parameterless constructor was found.
assemblyFile is not found.
typeName is an abstract class.
This member was invoked with a late-binding mechanism.
The caller cannot provide activation attributes for an object that does not inherit from MarshalByRefObject.
assemblyFile is the empty string ("").
assemblyFile is not a valid assembly.
An assembly or module was loaded twice with two different evidences.
The COM object that is being referred to is a null reference (Nothing in Visual Basic).
Use this method to create objects remotely without having to load the type locally.
The return value must to be unwrapped to access the real object.
A System.Runtime.InteropServices.ComVisibleAttribute attribute with a value of true must be applied either explicitly or by default to the COM type for this method to create an instance of that type; otherwise, TypeLoadException is thrown.
for the ability to access the location of the assembly. Associated enumeration: FileIOPermissionAccess.PathDiscovery
for the ability to read the file containing the assembly manifest. Associated enumeration: FileIOPermissionAccess.Read
for the ability to access the location of the assembly if the assembly is not local.
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.