O'Reilly logo

C# in a Nutshell by Peter Drayton, Ted Neward, Ben Albahari

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

FieldAccessException

Synopsis

This exception is thrown when you try to access a protected or private field that you would not normally have access to. Most compilers will not let you compile code that does this directly. However, late-bound code can sneak by the compiler and throw this exception at runtime. For example, if you lack sufficient privileges to modify a field using System.Reflection.FieldInfo.SetValue(), this exception is thrown.

public class FieldAccessException : MemberAccessException {
// Public Constructors
   public method FieldAccessException();  
   public method FieldAccessException(string message);  
   public method FieldAccessException(string message, 
        Exception inner);  
// Protected Constructors
   protected method FieldAccessException(
        System.Runtime.Serialization.SerializationInfo info, 
        System.Runtime.Serialization.StreamingContext context);  
}

Hierarchy

ObjectException(System.Runtime.Serialization.ISerializable)SystemExceptionMemberAccessExceptionFieldAccessException

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required