Instantiate the specified type defined in the specified assembly and optionally specifying whether the assembly is to be shared across application domains.
[Visual Basic] Overloads Public Function CreateInstance( _ ByVal assemblyname As String, _ ByVal typeName As String, _ ByVal shared As Boolean _ ) As ObjectHandle [C#] public ObjectHandle CreateInstance( string assemblyname, string typeName, bool shared ); [C++] public: ObjectHandle* CreateInstance( String* assemblyname, String* typeName, bool shared ); [JScript] public function CreateInstance( assemblyname : String, typeName : String, shared : Boolean ) : ObjectHandle;
Returns an ObjectHandle object that is a wrapper for the instantiated object. Returns a null reference (Nothing) if the type is not found. ObjectHandle needs to be unwrapped to access the real object.
Exception Type | Condition |
---|---|
ArgumentNullException | if assemblyString is a null reference (Nothing). |
AppDomain Class | AppDomain Members | System Namespace | AppDomain.CreateInstance Overload List