NotSupportedException NotSupportedException NotSupportedException NotSupportedException Class

Definición

Excepción que se produce cuando no se admite un método invocado o cuando se intenta leer, buscar o escribir en una secuencia que no admite la funcionalidad invocada.The exception that is thrown when an invoked method is not supported, or when there is an attempt to read, seek, or write to a stream that does not support the invoked functionality.

public ref class NotSupportedException : SystemException
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public class NotSupportedException : SystemException
type NotSupportedException = class
    inherit SystemException
Public Class NotSupportedException
Inherits SystemException
Herencia
NotSupportedExceptionNotSupportedExceptionNotSupportedExceptionNotSupportedException
Derivado
Atributos

Comentarios

NotSupportedExceptionindica que no existe ninguna implementación para una propiedad o método invocado.NotSupportedException indicates that no implementation exists for an invoked method or property.

NotSupportedExceptionusa HRESULT COR_E_NOTSUPPORTED, que tiene el valor 0x80131515.NotSupportedException uses the HRESULT COR_E_NOTSUPPORTED, which has the value 0x80131515.

Para obtener una lista de valores de propiedad iniciales de una instancia de NotSupportedException, consulte el NotSupportedException constructores.For a list of initial property values for an instance of NotSupportedException, see the NotSupportedException constructors.

Producir una excepción NotSupportedExceptionThrowing a NotSupportedException exception

Podría plantearse producir una NotSupportedException excepción en los casos siguientes:You might consider throwing a NotSupportedException exception in the following cases:

  • Está implementando una interfaz de uso general y el número de métodos no tiene ninguna implementación significativa.You are implementing a general-purpose interface, and number of the methods have no meaningful implementation. Por ejemplo, si va a crear un tipo de fecha y hora que implementa la IConvertible interfaz, se producirá una NotSupportedException excepción para la mayoría de las conversiones.For example, if you are creating a date and time type that implements the IConvertible interface, you would throw a NotSupportedException exception for most of the conversions.

  • Ha heredado de una clase abstracta que requiere que invalide una serie de métodos.You've inherited from an abstract class that requires that you override a number of methods. Sin embargo, solo está preparado para proporcionar una implementación para un subconjunto de ellos.However, you're only prepared to provide an implementation for a subset of these. En el caso de los métodos que decida no implementar, puede iniciar NotSupportedException.For the methods that you decide not to implement, you can choose to throw a NotSupportedException.

  • Está definiendo un tipo de uso general con un estado que habilita las operaciones de forma condicional.You are defining a general-purpose type with a state that enables operations conditionally. Por ejemplo, el tipo puede ser de solo lectura o de lectura y escritura.For example, your type can be either read-only or read-write. En ese caso:In that case:

    • Si el objeto es de solo lectura, el intento de asignar valores a las propiedades de una instancia o llamar a métodos que modifican el estado de NotSupportedException la instancia debería producir una excepción.If the object is read-only, attempting to assign values to the properties of an instance or call methods that modify instance state should throw a NotSupportedException exception.

    • Debe implementar una propiedad que devuelva un Boolean valor que indique si la funcionalidad determinada está disponible.You should implement a property that returns a Boolean value that indicates whether particular functionality is available. Por ejemplo, para un tipo que puede ser de solo lectura o de lectura y escritura, podría implementar una IsReadOnly propiedad que indica si el conjunto de métodos de lectura y escritura está disponible o no está disponible.For example, for a type that can be either read-only or read-write, you could implement a IsReadOnly property that indicates whether the set of read-write methods are available or unavailable.

Controlar una excepción NotSupportedExceptionHandling a NotSupportedException exception

La NotSupportedException excepción indica que un método no tiene ninguna implementación y que no se le debe llamar.The NotSupportedException exception indicates that a method has no implementation and that you should not call it. No debe controlar la excepción.You should not handle the exception. En su lugar, lo que debe hacer depende de la causa de la excepción: Si una implementación está completamente ausente o si la invocación del miembro es incoherente con el propósito de un objeto (por ejemplo, una FileStream.Write llamada al método en un objeto FileStream de solo lectura .Instead, what you should do depends on the cause of the exception: whether an implementation is completely absent , or the member invocation is inconsistent with the purpose of an object (such as a call to the FileStream.Write method on a read-only FileStream object .

No se ha proporcionado una implementación porque la operación no se puede realizar de forma significativa.An implementation has not been provided because the operation cannot be performed in a meaningful way.
Se trata de una excepción común cuando se llama a métodos en un objeto que proporciona implementaciones para los métodos de una clase base abstracta, o que implementa una interfaz de uso general, y el método no tiene ninguna implementación significativa.This is a common exception when you are calling methods on an object that provides implementations for the methods of an abstract base class, or that implements a general-purpose interface, and the method has no meaningful implementation.

Por ejemplo, la Convert clase implementa la IConvertible interfaz, lo que significa que debe incluir un método para convertir todos los tipos primitivos a todos los demás tipos primitivos.For example, the Convert class implements the IConvertible interface, which means that it must include a method to convert every primitive type to every other primitive type. Sin embargo, muchas de estas conversiones no son posibles.Many of those conversions, however, are not possible. Como resultado, una llamada Convert.ToBoolean(DateTime) al método, por ejemplo, produce una NotSupportedException excepción porque no hay DateTime ninguna conversión posible entre y un Boolean valor.As a result, a call to the Convert.ToBoolean(DateTime) method, for instance, throws a NotSupportedException exception because there is no possible conversion between a DateTime and a Boolean value

Para eliminar la excepción, debe eliminar la llamada al método.To eliminate the exception, you should eliminate the method call.

La llamada al método no se admite dado el estado del objeto.The method call is not supported given the state of the object.
Está intentando invocar un miembro cuya funcionalidad no está disponible debido al estado del objeto.You are attempting to invoke a member whose functionality is unavailable because of the object's state. Puede eliminar la excepción de una de estas tres maneras:You can eliminate the exception in one of three ways:

  • Conoce el estado del objeto de antemano, pero ha invocado un método o una propiedad no admitidos.You know the state of the object in advance, but you've invoked an unsupported method or property. En este caso, la invocación del miembro es un error y se puede eliminar.In this case, the member invocation is an error, and you can eliminate it.

  • Conoce el estado del objeto de antemano (normalmente porque el código ha creado una instancia), pero el objeto está mal configurado.You know the state of the object in advance (usually because your code has instantiated it), but the object is mis-configured. En el ejemplo siguiente se muestra este problema.The following example illustrates this issue. Crea un objeto de solo FileStream lectura y, a continuación, intenta escribir en él.It creates a read-only FileStream object and then attempts to write to it.

    using System;
    using System.IO;
    using System.Text;
    using System.Threading.Tasks;
    
    public class Example
    {
       public static async Task Main()
       {
          Encoding enc = Encoding.Unicode;
          String value = "This is a string to persist.";
          Byte[] bytes  = enc.GetBytes(value);
    
          FileStream fs = new FileStream(@".\TestFile.dat", 
                                         FileMode.Open,
                                         FileAccess.Read);
          Task t = fs.WriteAsync(enc.GetPreamble(), 0, enc.GetPreamble().Length);
          Task t2 = t.ContinueWith( (a) => fs.WriteAsync(bytes, 0, bytes.Length) ); 
          await t2;
          fs.Close();
       }
    }
    // The example displays the following output:
    //    Unhandled Exception: System.NotSupportedException: Stream does not support writing.
    //       at System.IO.Stream.BeginWriteInternal(Byte[] buffer, Int32 offset, Int32 count, AsyncCallback callback, Object state
    //    , Boolean serializeAsynchronously)
    //       at System.IO.FileStream.BeginWrite(Byte[] array, Int32 offset, Int32 numBytes, AsyncCallback userCallback, Object sta
    //    teObject)
    //       at System.IO.Stream.<>c.<BeginEndWriteAsync>b__53_0(Stream stream, ReadWriteParameters args, AsyncCallback callback,
    //    Object state)
    //       at System.Threading.Tasks.TaskFactory`1.FromAsyncTrim[TInstance,TArgs](TInstance thisRef, TArgs args, Func`5 beginMet
    //    hod, Func`3 endMethod)
    //       at System.IO.Stream.BeginEndWriteAsync(Byte[] buffer, Int32 offset, Int32 count)
    //       at System.IO.FileStream.WriteAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)
    //       at System.IO.Stream.WriteAsync(Byte[] buffer, Int32 offset, Int32 count)
    //       at Example.Main()
    
    Imports System.IO
    Imports System.Text
    Imports System.Threading.Tasks
    
    Module Example
       Public Sub Main()
          Dim enc As Encoding = Encoding.Unicode
          Dim value As String = "This is a string to persist."
          Dim bytes() As Byte = enc.GetBytes(value)
    
          Dim fs As New FileStream(".\TestFile.dat", 
                                   FileMode.Open,
                                   FileAccess.Read)
          Dim t As Task = fs.WriteAsync(enc.GetPreamble(), 0, enc.GetPreamble().Length)
          Dim t2 As Task = t.ContinueWith(Sub(a) fs.WriteAsync(bytes, 0, bytes.Length)) 
          t2.Wait()
          fs.Close()
       End Sub
    End Module
    ' The example displays the following output:
    '    Unhandled Exception: System.NotSupportedException: Stream does not support writing.
    '       at System.IO.Stream.BeginWriteInternal(Byte[] buffer, Int32 offset, Int32 count, AsyncCallback callback, Object state
    '    , Boolean serializeAsynchronously)
    '       at System.IO.FileStream.BeginWrite(Byte[] array, Int32 offset, Int32 numBytes, AsyncCallback userCallback, Object sta
    '    teObject)
    '       at System.IO.Stream.<>c.<BeginEndWriteAsync>b__53_0(Stream stream, ReadWriteParameters args, AsyncCallback callback,
    '    Object state)
    '       at System.Threading.Tasks.TaskFactory`1.FromAsyncTrim[TInstance,TArgs](TInstance thisRef, TArgs args, Func`5 beginMet
    '    hod, Func`3 endMethod)
    '       at System.IO.Stream.BeginEndWriteAsync(Byte[] buffer, Int32 offset, Int32 count)
    '       at System.IO.FileStream.WriteAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)
    '       at System.IO.Stream.WriteAsync(Byte[] buffer, Int32 offset, Int32 count)
    '       at Example.Main()
    

    Puede eliminar la excepción asegurándose de que el objeto con instancias admite la funcionalidad que desee.You can eliminate the exception by ensuring that the instantiated object supports the functionality you intend. En el ejemplo siguiente FileStream FileStream.FileStream(String, FileMode, FileAccess) se aborda el problema del objeto de solo lectura proporcionando los argumentos correctos al constructor.The following example addresses the problem of the read-only FileStream object by providing the correct arguments to the FileStream.FileStream(String, FileMode, FileAccess) constructor.

  • No conoce el estado del objeto de antemano y el objeto no admite una operación determinada.You don't know the state of the object in advance, and the object doesn't support a particular operation. En la mayoría de los casos, el objeto debe incluir una propiedad o un método que indique si admite un conjunto determinado de operaciones.In most cases, the object should include a property or method that indicates whether it supports a particular set of operations. Puede eliminar la excepción comprobando el valor del objeto e invocando el miembro solo si es necesario.You can eliminate the exception by checking the value of the object and invoking the member only if appropriate.

    En el ejemplo siguiente se DetectEncoding define un método que produce NotSupportedException una excepción al intentar leer desde el principio de una secuencia que no admite el acceso de lectura.The following example defines a DetectEncoding method that throws a NotSupportedException exception when it attempts to read from the beginning of a stream that does not support read access.

    using System;
    using System.IO;
    using System.Threading.Tasks;
    
    public class Example
    {
       public static async Task Main()
       {
          String name = @".\TestFile.dat";
          var fs = new FileStream(name, 
                                  FileMode.Create,
                                  FileAccess.Write);
             Console.WriteLine("Filename: {0}, Encoding: {1}", 
                               name, await FileUtilities.GetEncodingType(fs));
       }
    }
    
    public class FileUtilities
    {
       public enum EncodingType
       { None = 0, Unknown = -1, Utf8 = 1, Utf16 = 2, Utf32 = 3 }
       
       public async static Task<EncodingType> GetEncodingType(FileStream fs)
       {
          Byte[] bytes = new Byte[4];
          int bytesRead = await fs.ReadAsync(bytes, 0, 4);
          if (bytesRead < 2)
             return EncodingType.None;
          
          if (bytesRead >= 3 & (bytes[0] == 0xEF && bytes[1] == 0xBB && bytes[2] == 0xBF))
             return EncodingType.Utf8;
          
          if (bytesRead == 4) { 
             var value = BitConverter.ToUInt32(bytes, 0);
             if (value == 0x0000FEFF | value == 0xFEFF0000)
                return EncodingType.Utf32;
          }
          
          var value16 = BitConverter.ToUInt16(bytes, 0);
          if (value16 == (ushort)0xFEFF | value16 == (ushort)0xFFFE) 
             return EncodingType.Utf16;
          
          return EncodingType.Unknown;
       }
    }
    // The example displays the following output:
    //    Unhandled Exception: System.NotSupportedException: Stream does not support reading.
    //       at System.IO.FileStream.BeginRead(Byte[] array, Int32 offset, Int32 numBytes, AsyncCallback callback, Object state)
    //       at System.IO.Stream.<>c.<BeginEndReadAsync>b__46_0(Stream stream, ReadWriteParameters args, AsyncCallback callback, Object state)
    //       at System.Threading.Tasks.TaskFactory`1.FromAsyncTrim[TInstance, TArgs](TInstance thisRef, TArgs args, Func`5 beginMethod, Func`3 endMethod)
    //       at System.IO.Stream.BeginEndReadAsync(Byte[] buffer, Int32 offset, Int32 count)
    //       at System.IO.FileStream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)
    //       at System.IO.Stream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count)
    //       at FileUtilities.GetEncodingType(FileStream fs) in C:\Work\docs\program.cs:line 26
    //       at Example.Main() in C:\Work\docs\program.cs:line 13
    //       at Example.<Main>()
    
    Imports System.IO
    Imports System.Threading.Tasks
    
    Module Example
       Public Sub Main()
          Dim name As String = ".\TestFile.dat"
          Dim fs As New FileStream(name, 
                                   FileMode.Create,
                                   FileAccess.Write)
          Console.WriteLine("Filename: {0}, Encoding: {1}", 
                            name, FileUtilities.GetEncodingType(fs))
       End Sub
    End Module
    
    Public Class FileUtilities
       Public Enum EncodingType As Integer
          None = 0
          Unknown = -1
          Utf8 = 1
          Utf16 = 2
          Utf32 = 3
       End Enum
       
       Public Shared Function GetEncodingType(fs As FileStream) As EncodingType
          Dim bytes(3) As Byte
          Dim t As Task(Of Integer) = fs.ReadAsync(bytes, 0, 4)
          t.Wait()
          Dim bytesRead As Integer = t.Result
          If bytesRead < 2 Then Return EncodingType.None
          
          If bytesRead >= 3 And (bytes(0) = &hEF AndAlso bytes(1) = &hBB AndAlso bytes(2) = &hBF) Then
             Return EncodingType.Utf8
          End If
          
          If bytesRead = 4 Then 
             Dim value As UInteger = BitConverter.ToUInt32(bytes, 0)
             If value = &h0000FEFF Or value = &hFEFF0000 Then
                Return EncodingType.Utf32
             End If
          End If
          
          Dim value16 As UInt16 = BitConverter.ToUInt16(bytes, 0)
          If value16 = &hFEFF Or value16 = &hFFFE Then 
             Return EncodingType.Utf16
          End If
          
          Return EncodingType.Unknown
       End Function
    End Class
    ' The example displays the following output:
    '    Unhandled Exception: System.NotSupportedException: Stream does not support reading.
    '       at System.IO.Stream.BeginReadInternal(Byte[] buffer, Int32 offset, Int32 count, AsyncCallback callback, Object state,
    '     Boolean serializeAsynchronously)
    '       at System.IO.FileStream.BeginRead(Byte[] array, Int32 offset, Int32 numBytes, AsyncCallback userCallback, Object stat
    '    eObject)
    '       at System.IO.Stream.<>c.<BeginEndReadAsync>b__43_0(Stream stream, ReadWriteParameters args, AsyncCallback callback, O
    '    bject state)
    '       at System.Threading.Tasks.TaskFactory`1.FromAsyncTrim[TInstance,TArgs](TInstance thisRef, TArgs args, Func`5 beginMet
    '    hod, Func`3 endMethod)
    '       at System.IO.Stream.BeginEndReadAsync(Byte[] buffer, Int32 offset, Int32 count)
    '       at System.IO.FileStream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)
    '       at System.IO.Stream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count)
    '       at FileUtilities.GetEncodingType(FileStream fs)
    '       at Example.Main()
    

    Puede eliminar la excepción examinando el valor de la FileStream.CanRead propiedad y saliendo del método si la secuencia es de solo lectura.You can eliminate the exception by examining the value of the FileStream.CanRead property and exiting the method if the stream is read-only.

       public static async Task<EncodingType> GetEncodingType(FileStream fs)
       {
          if (!fs.CanRead) 
             return EncodingType.Unknown;
    
          Byte[] bytes = new Byte[4];
          int bytesRead = await fs.ReadAsync(bytes, 0, 4);
          if (bytesRead < 2)
             return EncodingType.None;
          
          if (bytesRead >= 3 & (bytes[0] == 0xEF && bytes[1] == 0xBB && bytes[2] == 0xBF))
             return EncodingType.Utf8;
          
          if (bytesRead == 4) { 
             var value = BitConverter.ToUInt32(bytes, 0);
             if (value == 0x0000FEFF | value == 0xFEFF0000)
                return EncodingType.Utf32;
          }
          
          var value16 = BitConverter.ToUInt16(bytes, 0);
          if (value16 == (ushort)0xFEFF | value16 == (ushort)0xFFFE) 
             return EncodingType.Utf16;
          
          return EncodingType.Unknown;
       }
    }
    // The example displays the following output:
    //       Filename: .\TestFile.dat, Encoding: Unknown
    
    Public Class FileUtilities
       Public Enum EncodingType As Integer
          None = 0
          Unknown = -1
          Utf8 = 1
          Utf16 = 2
          Utf32 = 3
       End Enum
       
       Public Shared Function GetEncodingType(fs As FileStream) As EncodingType
          If Not fs.CanRead Then
             Return EncodingType.Unknown
    
          Dim bytes(3) As Byte
          Dim t As Task(Of Integer) = fs.ReadAsync(bytes, 0, 4)
          t.Wait()
          Dim bytesRead As Integer = t.Result
          If bytesRead < 2 Then Return EncodingType.None
          
          If bytesRead >= 3 And (bytes(0) = &hEF AndAlso bytes(1) = &hBB AndAlso bytes(2) = &hBF) Then
             Return EncodingType.Utf8
          End If
          
          If bytesRead = 4 Then 
             Dim value As UInteger = BitConverter.ToUInt32(bytes, 0)
             If value = &h0000FEFF Or value = &hFEFF0000 Then
                Return EncodingType.Utf32
             End If
          End If
          
          Dim value16 As UInt16 = BitConverter.ToUInt16(bytes, 0)
          If value16 = &hFEFF Or value16 = &hFFFE Then 
             Return EncodingType.Utf16
          End If
          
          Return EncodingType.Unknown
       End Function
    End Class
    ' The example displays the following output:
    '       Filename: .\TestFile.dat, Encoding: Unknown
    

La NotSupportedException excepción está estrechamente relacionada con otros dos tipos de excepción;The NotSupportedException exception is closely related to two other exception types;

NotImplementedException.NotImplementedException.
Esta excepción se produce cuando se puede implementar un método pero no es porque el miembro se implementará en una versión posterior, el miembro no está disponible en una plataforma concreta, o el miembro pertenece a una clase abstracta y una clase derivada debe proporcionar una im plementation.This exception is thrown when a method could be implemented but is not, either because the member will be implemented in a later version, the member is not available on a particular platform, or the member belongs to an abstract class and a derived class must provide an implementation.

InvalidOperationException
Esta excepción se produce en escenarios en los que a veces es posible que el objeto realice la operación solicitada, y el estado del objeto determina si se puede realizar la operación.This exception is thrown in scenarios in which it is generally sometimes possible for the object to perform the requested operation, and the object state determines whether the operation can be performed.

Notas de .NET Compact Framework.NET Compact Framework notes

Al trabajar con .NET Compact Framework.NET Compact Framework y usar P/Invoke en una función nativa, se puede producir esta excepción si:When working with the .NET Compact Framework.NET Compact Framework and using P/Invoke on a native function, this exception may be thrown if:

  • La declaración en código administrado es incorrecta.The declaration in managed code is incorrect.

  • .NET Compact Framework.NET Compact Framework no admite lo que se intenta hacer.The .NET Compact Framework.NET Compact Framework does not support what you are trying to do.

  • Los nombres del archivo DLL tienen un sufijo en exportación.The DLL names are mangled on export.

Si se NotSupportedException produce una excepción, compruebe lo siguiente:If a NotSupportedException exception is thrown, check:

  • Alguna infracción a las restricciones P/Invoke de .NET Compact Framework.NET Compact Framework .For any violations of the .NET Compact Framework.NET Compact Framework P/Invoke restrictions.

  • Algún argumento que requiera memoria previamente asignada.For any arguments that require pre-allocated memory. Si éstos existen, debe pasar una referencia a una variable existente.If these exist, you should pass a reference to an existing variable.

  • Que los nombres de las funciones exportadas sean correctos.That the names of the exported functions are correct. Esto se puede comprobar con DumpBin. exe.This can be verified with DumpBin.exe.

  • Que no intenta pasar demasiados argumentos.That you are not attempting to pass too many arguments.

Constructores

NotSupportedException() NotSupportedException() NotSupportedException() NotSupportedException()

Inicializa una nueva instancia de la clase NotSupportedException, estableciendo la propiedad Message de una nueva instancia en un mensaje proporcionado por el sistema que describe el error.Initializes a new instance of the NotSupportedException class, setting the Message property of the new instance to a system-supplied message that describes the error. Este mensaje tiene en cuenta la referencia cultural del sistema actual.This message takes into account the current system culture.

NotSupportedException(SerializationInfo, StreamingContext) NotSupportedException(SerializationInfo, StreamingContext) NotSupportedException(SerializationInfo, StreamingContext) NotSupportedException(SerializationInfo, StreamingContext)

Inicializa una nueva instancia de la clase NotSupportedException con datos serializados.Initializes a new instance of the NotSupportedException class with serialized data.

NotSupportedException(String) NotSupportedException(String) NotSupportedException(String) NotSupportedException(String)

Inicializa una nueva instancia de la clase NotSupportedException con el mensaje de error especificado.Initializes a new instance of the NotSupportedException class with a specified error message.

NotSupportedException(String, Exception) NotSupportedException(String, Exception) NotSupportedException(String, Exception) NotSupportedException(String, Exception)

Inicializa una nueva instancia de la clase NotSupportedException con el mensaje de error especificado y una referencia a la excepción interna que representa la causa de esta excepción.Initializes a new instance of the NotSupportedException class with a specified error message and a reference to the inner exception that is the cause of this exception.

Propiedades

Data Data Data Data

Obtiene una colección de pares clave-valor que proporcionan más información definida por el usuario sobre la excepción.Gets a collection of key/value pairs that provide additional user-defined information about the exception.

(Inherited from Exception)
HelpLink HelpLink HelpLink HelpLink

Obtiene o establece un vínculo al archivo de ayuda asociado a esta excepción.Gets or sets a link to the help file associated with this exception.

(Inherited from Exception)
HResult HResult HResult HResult

Obtiene o establece HRESULT, un valor numérico codificado que se asigna a una excepción específica.Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception.

(Inherited from Exception)
InnerException InnerException InnerException InnerException

Obtiene la instancia Exception que produjo la excepción actual.Gets the Exception instance that caused the current exception.

(Inherited from Exception)
Message Message Message Message

Obtiene un mensaje que describe la excepción actual.Gets a message that describes the current exception.

(Inherited from Exception)
Source Source Source Source

Devuelve o establece el nombre de la aplicación o del objeto que generó el error.Gets or sets the name of the application or the object that causes the error.

(Inherited from Exception)
StackTrace StackTrace StackTrace StackTrace

Obtiene una representación de cadena de los marcos inmediatos en la pila de llamadas.Gets a string representation of the immediate frames on the call stack.

(Inherited from Exception)
TargetSite TargetSite TargetSite TargetSite

Obtiene el método que produjo la excepción actual.Gets the method that throws the current exception.

(Inherited from Exception)

Métodos

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determina si el objeto especificado es igual al objeto actual.Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetBaseException() GetBaseException() GetBaseException() GetBaseException()

Cuando se reemplaza en una clase derivada, devuelve la clase Exception que representa la causa principal de una o más excepciones posteriores.When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions.

(Inherited from Exception)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Sirve como la función hash predeterminada.Serves as the default hash function.

(Inherited from Object)
GetObjectData(SerializationInfo, StreamingContext) GetObjectData(SerializationInfo, StreamingContext) GetObjectData(SerializationInfo, StreamingContext) GetObjectData(SerializationInfo, StreamingContext)

Cuando se reemplaza en una clase derivada, establece SerializationInfo con información sobre la excepción.When overridden in a derived class, sets the SerializationInfo with information about the exception.

(Inherited from Exception)
GetType() GetType() GetType() GetType()

Obtiene el tipo de tiempo de ejecución de la instancia actual.Gets the runtime type of the current instance.

(Inherited from Exception)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Crea una copia superficial del objeto Object actual.Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

Crea y devuelve una representación de cadena de la excepción actual.Creates and returns a string representation of the current exception.

(Inherited from Exception)

Eventos

SerializeObjectState SerializeObjectState SerializeObjectState SerializeObjectState

Ocurre cuando una excepción se serializa para crear un objeto de estado de excepción que contenga datos serializados sobre la excepción.Occurs when an exception is serialized to create an exception state object that contains serialized data about the exception.

(Inherited from Exception)

Se aplica a

Consulte también: