Creates a new instance of the specified object type.
[Visual Basic] Public Shared Function GetUninitializedObject( _ ByVal type As Type _ ) As Object [C#] public static object GetUninitializedObject( Type type ); [C++] public: static Object* GetUninitializedObject( Type* type ); [JScript] public static function GetUninitializedObject( type : Type ) : Object;
A zeroed object of the specified type.
Exception Type | Condition |
---|---|
ArgumentNullException | the type parameter is a null reference (in Visual Basic Nothing). |
The new instance of the object is initialized to 0 and no constructors are run. This means that the object may not represent a state that is regarded as valid by that object. This method should only be used for deserialization when the user intends to immediately populate all fields. The method will not create an un-initialized string, since creating an empty instance of an immutable type is pointless.
FormatterServices Class | FormatterServices Members | System.Runtime.Serialization Namespace