FieldAccessException
Class
Definition
The exception that is thrown when there is an invalid attempt to access a private or protected field inside a class.
[System.Runtime.InteropServices.ComVisible(true)]
public class FieldAccessException : MemberAccessException
- Inheritance
- Attributes
Inherited Members
System.Exception
System.Object
Remarks
This exception is typically thrown when the access level of a field in a class library is changed, and one or more assemblies referencing the library have not been recompiled.
FieldAccessException uses the HRESULT COR_E_FIELDACCESS, which has the value 0x80131507.
For a list of initial property values for an instance of FieldAccessException, see the FieldAccessException constructors.
Note
This exception is not included in the .NET for Windows Store apps or the , but it is thrown by some members that are. To catch the exception in that case, write a catch statement for MemberAccessException instead.
Constructors
| FieldAccessException() |
Initializes a new instance of the FieldAccessException class. |
| FieldAccessException(String) |
Initializes a new instance of the FieldAccessException class with a specified error message. |
| FieldAccessException(SerializationInfo, StreamingContext) |
Initializes a new instance of the FieldAccessException class with serialized data. |
| FieldAccessException(String, Exception) |
Initializes a new instance of the FieldAccessException class with a specified error message and a reference to the inner exception that is the cause of this exception. |