NotSupportedException NotSupportedException NotSupportedException NotSupportedException Class

Definición

Excepción que se produce cuando un método invocado no es compatible o cuando se intenta leer, buscar o escribir en una secuencia que no es compatible con las funciones invocadas.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

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

NotSupportedException utiliza HRESULT COR_E_NOTSUPPORTED, que tiene el valor 0 x 80131515.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

Es posible que considere la posibilidad de producir una NotSupportedException excepciones en los casos siguientes:You might consider throwing a NotSupportedException exception in the following cases:

  • Está implementando una interfaz de propósito general y número de los 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 está creando una fecha y hora tipo que implementa el IConvertible interfaz, se iniciaba 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 reemplace una serie de métodos.You've inherited from an abstract class that requires that you override a number of methods. Sin embargo, sólo 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. Para los métodos que decida no implementar, puede elegir producir un NotSupportedException.For the methods that you decide not to implement, you can choose to throw a NotSupportedException.

  • Define un tipo de uso general con un estado que permite 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 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, intentando asignar valores a las propiedades de una instancia o llamada a métodos que modifican el estado de la instancia debe producir una NotSupportedException 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 devuelve un Boolean valor que indica si la funcionalidad concreta 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 lectura y escritura, podría implementar un IsReadOnly propiedad que indica si el conjunto de métodos de lectura y escritura son 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

El NotSupportedException excepción indica que un método no tiene ninguna implementación y que no debe llamarlo.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 no está presente por completo o la invocación del miembro no es coherente con el objetivo de un objeto (como una llamada a la FileStream.Write método en solo lectura FileStream objeto .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 no se puede realizar la operación de forma significativa.An implementation has not been provided because the operation cannot be performed in a meaningful way.
Esto es habitual de excepció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 propósito 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, el Convert la clase implementa la IConvertible interfaz, lo que significa que debe incluir un método para convertir todos los tipos primitivos en 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 esas conversiones, no son posibles.Many of those conversions, however, are not possible. Como resultado, una llamada a la Convert.ToBoolean(DateTime) método, por ejemplo, se produce un NotSupportedException excepción porque no hay ninguna conversión posible entre un DateTime y un Boolean valorAs 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 a un miembro cuya funcionalidad 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 en uno de tres maneras:You can eliminate the exception in one of three ways:

  • Se sabe con antelación el estado del objeto, pero se ha invocado un método no admitido o una propiedad.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 puede eliminarlo.In this case, the member invocation is an error, and you can eliminate it.

  • Saber de antemano el estado del objeto (normalmente porque el código ha instanciado), pero el objeto no está bien configurado.You know the state of the object in advance (usually because your code has instantiated it), but the object is mis-configured. El ejemplo siguiente ilustra este problema.The following example illustrates this issue. Crea sólo lectura FileStream objeto 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 es compatible con la funcionalidad que desea.You can eliminate the exception by ensuring that the instantiated object supports the functionality you intend. El ejemplo siguiente corrige el problema de solo lectura FileStream objeto proporcionando los argumentos correctos a la FileStream.FileStream(String, FileMode, FileAccess) 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 es compatible con 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 método que indica 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 al comprobar el valor del objeto e invoca al 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 define un DetectEncoding método que produce una NotSupportedException excepción cuando intenta 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 sale 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
    

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

NotImplementedException.NotImplementedException.
Esta excepción se produce cuando un método se puede implementar, pero no lo es, ya sea 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 un mensaje instantáneo 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 normalmente a veces resulta posible para el objeto realizar 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 un NotSupportedException se produce una excepción, compruebe: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 invalida 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 invalida 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 en 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 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: