Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
374 lines (345 sloc) 23.4 KB
<Type Name="MissingFieldException" FullName="System.MissingFieldException">
<TypeSignature Language="C#" Value="public class MissingFieldException : MissingMemberException" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi serializable beforefieldinit MissingFieldException extends System.MissingMemberException implements class System.Runtime.Serialization.ISerializable" />
<TypeSignature Language="DocId" Value="T:System.MissingFieldException" />
<TypeSignature Language="VB.NET" Value="Public Class MissingFieldException&#xA;Inherits MissingMemberException" />
<TypeSignature Language="C++ CLI" Value="public ref class MissingFieldException : MissingMemberException" />
<TypeSignature Language="F#" Value="type MissingFieldException = class&#xA; inherit MissingMemberException&#xA; interface ISerializable" />
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.MissingMemberException</BaseTypeName>
</Base>
<Interfaces>
<Interface>
<InterfaceName>System.Runtime.Serialization.ISerializable</InterfaceName>
</Interface>
</Interfaces>
<Attributes>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8">
<AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0">
<AttributeName>System.Serializable</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>The exception that is thrown when there is an attempt to dynamically access a field that does not exist. If a field in a class library has been removed or renamed, recompile any assemblies that reference that library.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Normally a compilation error is generated if code attempts to access a nonexistent member of a class. <xref:System.MissingFieldException> is designed to handle cases where an attempt is made to dynamically access a renamed or deleted field of an assembly that is not referenced by its strong name. The <xref:System.MissingFieldException> is thrown when code in a dependent assembly attempts to access a missing field in an assembly that was modified.
<xref:System.MissingFieldException> uses the HRESULT COR_E_MISSINGFIELD, that has the value 0x80131511.
For a list of initial property values for an instance of <xref:System.MissingFieldException>, see the <xref:System.MissingFieldException.%23ctor%2A> constructors.
## Examples
This example shows what happens if you attempt to use reflection to call a method that does not exist and access a field that does not exist. The application recovers by catching the <xref:System.MissingMethodException>, <xref:System.MissingFieldException>, and <xref:System.MissingMemberException>.
[!code-cpp[MissingMethodException#1](~/samples/snippets/cpp/VS_Snippets_CLR/MissingMethodException/cpp/MissingMethodException.cpp#1)]
[!code-csharp[MissingMethodException#1](~/samples/snippets/csharp/VS_Snippets_CLR/MissingMethodException/CS/MissingMethodException.cs#1)]
[!code-vb[MissingMethodException#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/MissingMethodException/vb/missingmethodexception.vb#1)]
]]></format>
</remarks>
<altmember cref="T:System.Exception" />
<related type="Article" href="~/docs/standard/exceptions/index.md">Handling and Throwing Exceptions</related>
</Docs>
<Members>
<MemberGroup MemberName=".ctor">
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.MissingFieldException" /> class.</summary>
</Docs>
</MemberGroup>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public MissingFieldException ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.MissingFieldException.#ctor" />
<MemberSignature Language="VB.NET" Value="Public Sub New ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; MissingFieldException();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters />
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.MissingFieldException" /> class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This constructor initializes <xref:System.MissingFieldException.Message%2A> property of the new instance to a system-supplied message that describes the error, such as "Attempted to access a non-existing field." This message takes into account the current system culture.
The following table shows the initial property values for an instance of <xref:System.MissingFieldException>.
|Property|Value|
|--------------|-----------|
|<xref:System.Exception.InnerException%2A>|A null reference (`Nothing` in Visual Basic).|
|<xref:System.MissingFieldException.Message%2A>|The localized error message string.|
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public MissingFieldException (string message);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string message) cil managed" />
<MemberSignature Language="DocId" Value="M:System.MissingFieldException.#ctor(System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (message As String)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; MissingFieldException(System::String ^ message);" />
<MemberSignature Language="F#" Value="new MissingFieldException : string -&gt; MissingFieldException" Usage="new System.MissingFieldException message" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="message" Type="System.String" />
</Parameters>
<Docs>
<param name="message">A <see cref="T:System.String" /> that describes the error.</param>
<summary>Initializes a new instance of the <see cref="T:System.MissingFieldException" /> class with a specified error message.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The content of `message` should be understandable to the user. The caller of this constructor is required to ensure that this string has been localized for the current system culture.
The following table shows the initial property values for an instance of <xref:System.MissingFieldException>.
|Property|Value|
|--------------|-----------|
|<xref:System.Exception.InnerException%2A>|A null reference (`Nothing` in Visual Basic).|
|<xref:System.MissingFieldException.Message%2A>|The error message string.|
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="protected MissingFieldException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor(class System.Runtime.Serialization.SerializationInfo info, valuetype System.Runtime.Serialization.StreamingContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:System.MissingFieldException.#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)" />
<MemberSignature Language="VB.NET" Value="Protected Sub New (info As SerializationInfo, context As StreamingContext)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; MissingFieldException(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);" />
<MemberSignature Language="F#" Value="new MissingFieldException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -&gt; MissingFieldException" Usage="new System.MissingFieldException (info, context)" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Security.SecuritySafeCritical</AttributeName>
</Attribute>
</Attributes>
<Parameters>
<Parameter Name="info" Type="System.Runtime.Serialization.SerializationInfo" Index="0" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1" />
<Parameter Name="context" Type="System.Runtime.Serialization.StreamingContext" Index="1" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1" />
</Parameters>
<Docs>
<param name="info">The object that holds the serialized object data.</param>
<param name="context">The contextual information about the source or destination.</param>
<summary>Initializes a new instance of the <see cref="T:System.MissingFieldException" /> class with serialized data.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This constructor is called during deserialization to reconstitute the exception object transmitted over a stream. For more information, see [XML and SOAP Serialization](~/docs/standard/serialization/xml-and-soap-serialization.md).
]]></format>
</remarks>
<related type="Article" href="~/docs/standard/serialization/xml-and-soap-serialization.md">XML and SOAP Serialization</related>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public MissingFieldException (string message, Exception inner);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string message, class System.Exception inner) cil managed" />
<MemberSignature Language="DocId" Value="M:System.MissingFieldException.#ctor(System.String,System.Exception)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (message As String, inner As Exception)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; MissingFieldException(System::String ^ message, Exception ^ inner);" />
<MemberSignature Language="F#" Value="new MissingFieldException : string * Exception -&gt; MissingFieldException" Usage="new System.MissingFieldException (message, inner)" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="message" Type="System.String" />
<Parameter Name="inner" Type="System.Exception" />
</Parameters>
<Docs>
<param name="message">The error message that explains the reason for the exception.</param>
<param name="inner">The exception that is the cause of the current exception. If the <paramref name="inner" /> parameter is not a null reference (<see langword="Nothing" /> in Visual Basic), the current exception is raised in a <see langword="catch" /> block that handles the inner exception.</param>
<summary>Initializes a new instance of the <see cref="T:System.MissingFieldException" /> class with a specified error message and a reference to the inner exception that is the cause of this exception.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
An exception that is thrown as a direct result of a previous exception can include a reference to the previous exception in the <xref:System.Exception.InnerException%2A> property. The <xref:System.Exception.InnerException%2A> property returns the same value that is passed into the constructor, or a null reference (`Nothing` in Visual Basic) if the <xref:System.Exception.InnerException%2A> property does not supply the inner exception value to the constructor.
The following table shows the initial property values for an instance of <xref:System.MissingFieldException>.
|Property|Value|
|--------------|-----------|
|<xref:System.Exception.InnerException%2A>|The inner exception reference.|
|<xref:System.MissingFieldException.Message%2A>|The error message string.|
]]></format>
</remarks>
<altmember cref="T:System.Exception" />
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public MissingFieldException (string className, string fieldName);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string className, string fieldName) cil managed" />
<MemberSignature Language="DocId" Value="M:System.MissingFieldException.#ctor(System.String,System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (className As String, fieldName As String)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; MissingFieldException(System::String ^ className, System::String ^ fieldName);" />
<MemberSignature Language="F#" Value="new MissingFieldException : string * string -&gt; MissingFieldException" Usage="new System.MissingFieldException (className, fieldName)" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="className" Type="System.String" Index="0" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1" />
<Parameter Name="fieldName" Type="System.String" Index="1" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1" />
</Parameters>
<Docs>
<param name="className">The name of the class in which access to a nonexistent field was attempted.</param>
<param name="fieldName">The name of the field that cannot be accessed.</param>
<summary>Initializes a new instance of the <see cref="T:System.MissingFieldException" /> class with the specified class name and field name.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Message">
<MemberSignature Language="C#" Value="public override string Message { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance string Message" />
<MemberSignature Language="DocId" Value="P:System.MissingFieldException.Message" />
<MemberSignature Language="VB.NET" Value="Public Overrides ReadOnly Property Message As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::String ^ Message { System::String ^ get(); };" />
<MemberSignature Language="F#" Value="member this.Message : string" Usage="System.MissingFieldException.Message" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8">
<AttributeName>get: System.Security.SecuritySafeCritical</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the text string showing the signature of the missing field, the class name, and the field name. This property is read-only.</summary>
<value>The error message string.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If the class name is not specified when the object is constructed, the default text string inherited from the base class is returned. This property overrides <xref:System.MissingMemberException.Message%2A>. The error message should be localized.
## Examples
The following example demonstrates the <xref:System.MissingFieldException.Message%2A> property. This code example is part of a larger example provided for the <xref:System.MissingFieldException> class.
[!code-cpp[MissingMethodException#3](~/samples/snippets/cpp/VS_Snippets_CLR/MissingMethodException/cpp/MissingMethodException.cpp#3)]
[!code-csharp[MissingMethodException#3](~/samples/snippets/csharp/VS_Snippets_CLR/MissingMethodException/CS/MissingMethodException.cs#3)]
[!code-vb[MissingMethodException#3](~/samples/snippets/visualbasic/VS_Snippets_CLR/MissingMethodException/vb/missingmethodexception.vb#3)]
]]></format>
</remarks>
</Docs>
</Member>
</Members>
</Type>
You can’t perform that action at this time.