AssemblyKeyFileAttribute(String) 建構函式

定義

使用檔案名稱來初始化 AssemblyKeyFileAttribute 類別的新執行個體,該檔案包含金鑰組,用來產生使用屬性之組件的強式名稱。

public:
 AssemblyKeyFileAttribute(System::String ^ keyFile);
public AssemblyKeyFileAttribute (string keyFile);
new System.Reflection.AssemblyKeyFileAttribute : string -> System.Reflection.AssemblyKeyFileAttribute
Public Sub New (keyFile As String)

參數

keyFile
String

包含金鑰組的檔案名稱。

備註

建構函式 AssemblyKeyFileAttribute 沒有預設路徑。 建構函式所設定的值是由連結器或叫用連結器的 Microsoft Visual Studio 2005 解譯。

Al.exe (元件連結器 ) 工具的預設設定會假設密鑰檔位於目前目錄中。 在 Visual Studio 2005 中,Visual Basic 和 Visual C# 編譯程式會建置並連結至專案目錄的子目錄,因此如果您將索引鍵檔案放在專案目錄中,相對路徑可能是 “.\..\keyfile.snk“ 或 ”..Visual Basic 中的 \keyfile.snk“ 或 ”..\\..\\keyfile.snk“ 或 ”..C# 中的 \\keyfile.snk“。 針對 C#,可以在專案屬性中設定此屬性。

警告

因為路徑和檔名持續存在,所以請確定您使用的 AssemblyKeyFileAttribute 字串不包含敏感性資訊。

適用於