語言

Publish.RegisterAssembly(String) 方法

定義

註冊一個組件以實現 COM 互操作。

public:
 virtual void RegisterAssembly(System::String ^ AssemblyPath);
public void RegisterAssembly(string AssemblyPath);
abstract member RegisterAssembly : string -> unit
override this.RegisterAssembly : string -> unit
Public Sub RegisterAssembly (AssemblyPath As String)

參數

AssemblyPath
String

組合語言的檔案系統路徑。

實作

例外狀況

輸入組件沒有強名。

呼叫鏈中的呼叫者沒有權限存取非管理程式碼。

-或-

若程式碼庫不以「file://」開頭,則未包含所需的 WebPermission。

AssemblyPath 是 null。

AssemblyPath 找不到檔案,或未指定副檔名。

AssemblyPath 不是一個有效的組裝。

一個組件或模組載入兩次,且有兩個不同的證據,或組件名稱超過系統定義的最大長度。

標記為 ComUnregisterFunctionAttribute 的方法不是 static。

-或-

在給定階層的某一層級,有不只一種標記為 的方法 ComUnregisterFunctionAttribute 。

-或-

標記為 的方法 ComUnregisterFunctionAttribute 簽名無效。

備註

RegisterAssembly 使用 Assembly 註冊工具(Regasm.exe)來註冊 assembly 中的可創建類別。 欲了解更多資訊,請參閱 Regasm.exe(組裝註冊工具)。

適用於