Missing Class
Represents a missing Object. This class cannot be inherited.
Assembly: mscorlib (in mscorlib.dll)
| Name | Description | |
|---|---|---|
![]() | Equals(Object) | Determines whether the specified object is equal to the current object.(Inherited from Object.) |
![]() | GetHashCode() | Serves as the default hash function. (Inherited from Object.) |
![]() | GetType() | |
![]() | ToString() | Returns a string that represents the current object.(Inherited from Object.) |
| Name | Description | |
|---|---|---|
![]() ![]() | ISerializable.GetObjectData(SerializationInfo, StreamingContext) | Sets a SerializationInfo object with the logical context information needed to recreate the sole instance of the Missing object. |
The Missing class is used to invoke a method with a default argument, typically when using reflection.
Only one instance of Missing, which is returned by the Value field, ever exists.
The following example shows how to use the Missing object to invoke a method with a default argument by using reflection.
Imports System.Reflection <Assembly:CLSCompliant(True)> Public Class MissingClass Public Shared Sub MethodWithDefault(Optional value As Integer = 33) Console.WriteLine("value = {0}", value) End Sub End Class Public Module Example Public Sub Main() ' Invoke without reflection. MissingClass.MethodWithDefault() ' Invoke by using reflection. Dim t As Type = GetType(MissingClass) Dim mi As MethodInfo = t.GetMethod("MethodWithDefault") mi.Invoke(Nothing, { Missing.Value }) End Sub End Module ' The example displays the following output: ' value = 33 ' value = 33
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.




