NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

AppDomain.CreateInstance (String, String, Boolean, Object[])

Instantiate the specified type defined in the specified assembly. Optionally, the loaded assembly can be shared across application domains. A set of activation attributes can be supplied and evidence can be supplied.

[Visual Basic]
Overloads Public Function CreateInstance( _
   ByVal assemblyname As String, _
   ByVal typeName As String, _
   ByVal shared As Boolean, _
   ByVal activationAttributes() As Object _
) As ObjectHandle
[C#]
public ObjectHandle CreateInstance(
   string assemblyname,
   string typeName,
   bool shared,
   object[] activationAttributes
);
[C++]
public: ObjectHandle* CreateInstance(
   String* assemblyname,
   String* typeName,
   bool shared,
   Object* activationAttributes[]
);
[JScript]
public function CreateInstance(
   assemblyname : String,
   typeName : String,
   shared : Boolean,
   activationAttributes : Object[]
) : ObjectHandle;

Parameters

assemblyname
The display name of the assembly. See the description of System.AssemblyName for the format of the display name. If a null reference (in Visual Basic Nothing), the executing assembly is assumed.
typeName
The full name of the type.
shared
If true, the assembly is loaded in a form where its JIT-compiled code can be reused by multiple application domains (at a slight cost in code quality).
activationAttributes
One or more attributes that can participate in the activation. An example of an activation attribute is: URLAttribute ("http://hostname/vroot/objectname")

Return Value

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.

Exceptions

Exception Type Condition
ArgumentNullException if assemblyString is a null reference (Nothing).

See Also

AppDomain Class | AppDomain Members | System Namespace | AppDomain.CreateInstance Overload List