VCProjectReference.PublicKeyToken 属性

定义

获取已引用程序集的公钥标记。

public:
 property System::String ^ PublicKeyToken { System::String ^ get(); };
public:
 property Platform::String ^ PublicKeyToken { Platform::String ^ get(); };
[System.Runtime.InteropServices.DispId(2011)]
public string PublicKeyToken { [System.Runtime.InteropServices.DispId(2011)] get; }
[<System.Runtime.InteropServices.DispId(2011)>]
[<get: System.Runtime.InteropServices.DispId(2011)>]
member this.PublicKeyToken : string
Public ReadOnly Property PublicKeyToken As String

属性值

String

一个字符串,表示引用的程序集的公钥标记。

实现

属性

示例

有关如何编译和运行此示例的信息,请参阅 如何:编译项目模型扩展性的示例代码

下面的示例列出 PublicKeyToken 程序集引用的属性值:

[Visual Basic]

' Add a reference to Microsoft.VisualStudio.VCProjectEngine and have a   
' Visual C++ project loaded before running this example.  
Imports EnvDTE  
Imports Microsoft.VisualStudio.VCProjectEngine  

Public Module Module1  
    Sub Test()  
        Dim prj As VCProject  
        Dim vcar As VCAssemblyReference  
        prj = DTE.Solution.Projects.Item(1).Object  
        vcar = prj.VCReferences.item(1)   
        MsgBox("Public key token: " & vcar.PublicKeyToken)  
    End Sub  
End Module  

适用于