UnitTestAssertException.GetObjectData 方法

使用有关异常的信息设置 SerializationInfo

命名空间:  Microsoft.VisualStudio.TestTools.UnitTesting
程序集:  Microsoft.VisualStudio.QualityTools.UnitTestFramework(在 Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll 中)

语法

声明
<SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter := True)> _
Public Overrides Sub GetObjectData ( _
    info As SerializationInfo, _
    context As StreamingContext _
)
[SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)]
public override void GetObjectData(
    SerializationInfo info,
    StreamingContext context
)
[SecurityPermissionAttribute(SecurityAction::Demand, SerializationFormatter = true)]
public:
virtual void GetObjectData(
    SerializationInfo^ info, 
    StreamingContext context
) override
[<SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)>]
abstract GetObjectData : 
        info:SerializationInfo * 
        context:StreamingContext -> unit 
[<SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)>]
override GetObjectData : 
        info:SerializationInfo * 
        context:StreamingContext -> unit 
public override function GetObjectData(
    info : SerializationInfo, 
    context : StreamingContext
)

参数

实现

ISerializable.GetObjectData(SerializationInfo, StreamingContext)
_Exception.GetObjectData(SerializationInfo, StreamingContext)

异常

异常 条件
ArgumentNullException

info 参数为 nullnull 引用(在 Visual Basic 中为 Nothing)。

.NET Framework 安全性

请参见

参考

UnitTestAssertException 类

Microsoft.VisualStudio.TestTools.UnitTesting 命名空间