NotSupportedException NotSupportedException NotSupportedException NotSupportedException Class

定义

当调用的方法不受支持,或试图读取、查找或写入不支持调用功能的流时引发的异常。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
继承
NotSupportedExceptionNotSupportedExceptionNotSupportedExceptionNotSupportedException
派生
属性

注解

NotSupportedException 指示没有实现存在为调用的方法或属性。NotSupportedException indicates that no implementation exists for an invoked method or property.

NotSupportedException 使用 HRESULT COR_E_NOTSUPPORTED,其值 0x80131515。NotSupportedException uses the HRESULT COR_E_NOTSUPPORTED, which has the value 0x80131515.

有关实例的初始属性值的列表NotSupportedException,请参阅NotSupportedException构造函数。For a list of initial property values for an instance of NotSupportedException, see the NotSupportedException constructors.

引发 NotSupportedException 异常Throwing a NotSupportedException exception

你可以考虑引发NotSupportedException在以下情况下的异常:You might consider throwing a NotSupportedException exception in the following cases:

  • 要实现一个通用接口,并且有些方法有没有有意义的实现。You are implementing a general-purpose interface, and number of the methods have no meaningful implementation. 例如,如果要创建的日期和时间类型的实现IConvertible接口,将引发NotSupportedException的大部分转换异常。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.

  • 已继承自一个抽象类,需要重写的方法数。You've inherited from an abstract class that requires that you override a number of methods. 但是,你仅做好准备以提供这些子集的实现。However, you're only prepared to provide an implementation for a subset of these. 对于你决定不实现方法,您可以选择引发NotSupportedExceptionFor the methods that you decide not to implement, you can choose to throw a NotSupportedException.

  • 你正在定义有条件地启用操作的状态的通用类型。You are defining a general-purpose type with a state that enables operations conditionally. 例如,您的类型可以是只读或读写。For example, your type can be either read-only or read-write. 在这种情况下:In that case:

    • 如果对象是只读的尝试将值分配给属性的修改实例状态实例或调用方法应引发NotSupportedException异常。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.

    • 应实现该属性返回Boolean值,该值指示是否提供了特定功能。You should implement a property that returns a Boolean value that indicates whether particular functionality is available. 例如,可以是只读或读写的类型,您可以实现IsReadOnly属性,用于指示组的读写方法是否可用或不可用。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.

处理 NotSupportedException 异常Handling a NotSupportedException exception

NotSupportedException异常指出某个方法具有没有实现,并且,您不应调用它。The NotSupportedException exception indicates that a method has no implementation and that you should not call it. 不应处理异常。You should not handle the exception. 相反,应执行的操作取决于异常的原因: 实现是完全不存在,还是该成员的调用不一致、 目的在于对象 (如调用FileStream.Write方法的只读FileStream对象.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 .

尚未提供实现,因为不能有意义的方式执行该操作。An implementation has not been provided because the operation cannot be performed in a meaningful way.
这是常见异常在提供的抽象基类或实现的方法实现一个通用接口的对象上调用方法时,该方法具有没有有意义的实现。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.

例如,Convert类实现IConvertible接口,这意味着它必须包括将每个基元类型转换为其他每个基元类型的方法。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. 许多这些转换,但是,不能。Many of those conversions, however, are not possible. 因此,调用Convert.ToBoolean(DateTime)方法,例如,将引发NotSupportedException异常没有之间的转换可能因为DateTime和一个BooleanAs 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

若要消除此异常,应消除方法调用。To eliminate the exception, you should eliminate the method call.

方法调用不支持给定对象的状态。The method call is not supported given the state of the object.
您试图调用的成员对象的状态由于它的功能将不可用。You are attempting to invoke a member whose functionality is unavailable because of the object's state. 您可以消除此异常中有以下三种:You can eliminate the exception in one of three ways:

  • 提前知道对象的状态,但已调用不受支持的方法或属性。You know the state of the object in advance, but you've invoked an unsupported method or property. 在这种情况下,该成员的调用是一个错误,并可以消除这个问题。In this case, the member invocation is an error, and you can eliminate it.

  • (通常是因为你的代码还实例化它) 事先知道对象的状态,但该对象是配置错误。You know the state of the object in advance (usually because your code has instantiated it), but the object is mis-configured. 下面的示例说明了此问题。The following example illustrates this issue. 它将创建一个只读的FileStream对象,然后尝试对其进行写入。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()
    

    您可以消除实例化的对象支持的功能,你想通过确保异常。You can eliminate the exception by ensuring that the instantiated object supports the functionality you intend. 下面的示例解决的只读的问题FileStream对象提供的正确参数FileStream.FileStream(String, FileMode, FileAccess)构造函数。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.

  • 你在事先不知道对象的状态和对象不支持某一特定操作。You don't know the state of the object in advance, and the object doesn't support a particular operation. 在大多数情况下,该对象应包括的属性或方法,指示它是否支持一组特定的操作。In most cases, the object should include a property or method that indicates whether it supports a particular set of operations. 可以通过检查对象的值和调用该成员,仅当相应消除异常。You can eliminate the exception by checking the value of the object and invoking the member only if appropriate.

    下面的示例定义DetectEncoding方法将引发NotSupportedException它会尝试从一开始不支持读取访问的流读取时出现异常。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()
    

    您可以通过检查的值来消除异常FileStream.CanRead属性和退出该方法,如果流是只读的。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
    

NotSupportedException与两个其他异常类型; 密切相关异常The NotSupportedException exception is closely related to two other exception types;

NotImplementedExceptionNotImplementedException.
当一种方法可实现,但不是,将引发此异常是因为将在更高版本中实现该成员、 成员不是适用于特定的平台,或该成员所属的抽象类和派生的类必须提供一条即时消息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
在方案中它通常是有时对象来执行请求的操作,有可能引发此异常,并且对象状态确定是否可以执行该操作。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.

.NET Framework 精简版说明.NET Compact Framework notes

当使用 .NET Compact Framework.NET Compact Framework 并对本机函数使用 P/Invoke 时,如果出现以下情况,则会引发此异常:When working with the .NET Compact Framework.NET Compact Framework and using P/Invoke on a native function, this exception may be thrown if:

  • 托管代码中的声明不正确。The declaration in managed code is incorrect.

  • .NET Compact Framework.NET Compact Framework 不支持尝试执行的操作。The .NET Compact Framework.NET Compact Framework does not support what you are trying to do.

  • DLL 名称在导出时难以分辨。The DLL names are mangled on export.

如果NotSupportedException引发异常时,检查:If a NotSupportedException exception is thrown, check:

  • 任何违反 .NET Compact Framework.NET Compact Framework P/Invoke 限制的行为。For any violations of the .NET Compact Framework.NET Compact Framework P/Invoke restrictions.

  • 任何需要预分配内存的参数。For any arguments that require pre-allocated memory. 如果存在这种情况,应传递对现有变量的引用。If these exist, you should pass a reference to an existing variable.

  • 导出的函数的名称正确。That the names of the exported functions are correct. 这可以通过验证DumpBin.exeThis can be verified with DumpBin.exe.

  • 您没有尝试传递过多的参数。That you are not attempting to pass too many arguments.

构造函数

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

初始化 NotSupportedException 类的新实例,将新实例的 Message 属性设置为系统提供的描述错误的消息。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. 此消息将当前系统区域性考虑在内。This message takes into account the current system culture.

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

用序列化数据初始化 NotSupportedException 类的新实例。Initializes a new instance of the NotSupportedException class with serialized data.

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

用指定的错误消息初始化 NotSupportedException 类的新实例。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)

使用指定的错误消息和对作为此异常原因的内部异常的引用来初始化 NotSupportedException 类的新实例。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.

属性

Data Data Data Data

获取提供有关异常的其他用户定义信息的键/值对集合。Gets a collection of key/value pairs that provide additional user-defined information about the exception.

(Inherited from Exception)
HelpLink HelpLink HelpLink HelpLink

获取或设置指向与此异常关联的帮助文件链接。Gets or sets a link to the help file associated with this exception.

(Inherited from Exception)
HResult HResult HResult HResult

获取或设置 HRESULT(一个分配给特定异常的编码数字值)。Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception.

(Inherited from Exception)
InnerException InnerException InnerException InnerException

获取导致当前异常的 Exception 实例。Gets the Exception instance that caused the current exception.

(Inherited from Exception)
Message Message Message Message

获取描述当前异常的消息。Gets a message that describes the current exception.

(Inherited from Exception)
Source Source Source Source

获取或设置导致错误的应用程序或对象的名称。Gets or sets the name of the application or the object that causes the error.

(Inherited from Exception)
StackTrace StackTrace StackTrace StackTrace

获取调用堆栈上的即时框架字符串表示形式。Gets a string representation of the immediate frames on the call stack.

(Inherited from Exception)
TargetSite TargetSite TargetSite TargetSite

获取引发当前异常的方法。Gets the method that throws the current exception.

(Inherited from Exception)

方法

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

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

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

当在派生类中重写时,返回 Exception,它是一个或多个并发的异常的根源。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()

作为默认哈希函数。Serves as the default hash function.

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

当在派生类中重写时,用关于异常的信息设置 SerializationInfoWhen overridden in a derived class, sets the SerializationInfo with information about the exception.

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

获取当前实例的运行时类型。Gets the runtime type of the current instance.

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

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

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

创建并返回当前异常的字符串表示形式。Creates and returns a string representation of the current exception.

(Inherited from Exception)

事件

SerializeObjectState SerializeObjectState SerializeObjectState SerializeObjectState

当异常被序列化用来创建包含有关该异常的徐列出数据的异常状态对象时会出现该问题。Occurs when an exception is serialized to create an exception state object that contains serialized data about the exception.

(Inherited from Exception)

适用于

另请参阅