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

TargetException

Synopsis

This exception is thrown when you attempt to invoke a nonstatic method on a null object reference. (Note that in Beta1 of the .NET SDK, it was permissible to call a nonvirtual method against a null reference, so long as that method didn’t access any of the fields in the type. In Beta2 and beyond, this “feature” has been closed and removed.)

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

Hierarchy

System.ObjectSystem.Exception(System.Runtime.Serialization.ISerializable)System.ApplicationExceptionTargetException

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