Evidence.AddAssembly(Object) 方法

定义

注意

This method is obsolete. Please use AddAssemblyEvidence instead.

注意

Evidence.AddAssembly has been deprecated. Use AddAssemblyEvidence instead.

注意

现已弃用此 API。

将指定的程序集证据添加到证据集。

public:
 void AddAssembly(System::Object ^ id);
[System.Obsolete("This method is obsolete. Please use AddAssemblyEvidence instead.")]
public void AddAssembly (object id);
[System.Obsolete("Evidence.AddAssembly has been deprecated. Use AddAssemblyEvidence instead.")]
public void AddAssembly (object id);
public void AddAssembly (object id);
[System.Obsolete]
public void AddAssembly (object id);
[<System.Obsolete("This method is obsolete. Please use AddAssemblyEvidence instead.")>]
member this.AddAssembly : obj -> unit
[<System.Obsolete("Evidence.AddAssembly has been deprecated. Use AddAssemblyEvidence instead.")>]
member this.AddAssembly : obj -> unit
member this.AddAssembly : obj -> unit
[<System.Obsolete>]
member this.AddAssembly : obj -> unit
Public Sub AddAssembly (id As Object)

参数

id
Object

任意证据对象。

属性

例外

id 为 null。

id 不可序列化。

示例

下面的代码示例演示如何使用 AddAssembly 方法。 此示例是为 类提供的更大示例的 Evidence 一部分。

Console::WriteLine( "Adding assembly evidence." );
myEvidence->AddAssembly( "SN01" );
myEvidence->AddAssembly( gcnew Version( "0.0.0.0" ) );
myEvidence->AddAssembly( mSN );
Console::WriteLine( "Count of evidence items = {0}", myEvidence->Count );
Console.WriteLine("Adding assembly evidence.");
myEvidence.AddAssembly("SN01");
myEvidence.AddAssembly(new Version("0.0.0.0"));
myEvidence.AddAssembly(mSN);
Console.WriteLine("Count of evidence items = " + myEvidence.Count.ToString());
Console.WriteLine("Adding assembly evidence.")
myEvidence.AddAssembly("SN01")
myEvidence.AddAssembly(New Version("0.0.0.0"))
myEvidence.AddAssembly(mSN)
Console.WriteLine(("Count of evidence items = " & myEvidence.Count.ToString()))

注解

将此方法用于派生自程序集的证据。

注意

此方法不执行检查以防止添加重复类型的证据。 许多程序集证据对象可以同时存在。

适用于