Sdílet prostřednictvím


IRegistrationServices.RegisterAssembly Metoda

Definice

Zaregistruje třídy ve spravovaném sestavení, aby bylo možné vytvořit z modelu COM.

public:
 bool RegisterAssembly(System::Reflection::Assembly ^ assembly, System::Runtime::InteropServices::AssemblyRegistrationFlags flags);
public bool RegisterAssembly (System.Reflection.Assembly assembly, System.Runtime.InteropServices.AssemblyRegistrationFlags flags);
[System.Security.SecurityCritical]
public bool RegisterAssembly (System.Reflection.Assembly assembly, System.Runtime.InteropServices.AssemblyRegistrationFlags flags);
abstract member RegisterAssembly : System.Reflection.Assembly * System.Runtime.InteropServices.AssemblyRegistrationFlags -> bool
[<System.Security.SecurityCritical>]
abstract member RegisterAssembly : System.Reflection.Assembly * System.Runtime.InteropServices.AssemblyRegistrationFlags -> bool
Public Function RegisterAssembly (assembly As Assembly, flags As AssemblyRegistrationFlags) As Boolean

Parametry

assembly
Assembly

Sestavení, které má být zaregistrováno.

flags
AssemblyRegistrationFlags

Hodnota AssemblyRegistrationFlags označující všechna speciální nastavení potřebná assemblypři registraci .

Návraty

true if assembly contains types that were successfully registered; otherwise false if the assembly contains no eligible types.

Atributy

Výjimky

assembly je null.

Úplný název assembly je null.

-nebo-

Metoda označená ComRegisterFunctionAttribute pomocí není static.

-nebo-

Na dané úrovni hierarchie je označeno ComRegisterFunctionAttribute více než jedna metoda.

-nebo-

Podpis metody označené ComRegisterFunctionAttribute pomocí není platný.

Poznámky

RegisterAssembly přidá příslušné položky registru pro typy v zadaném sestavení. Tato metoda také volá všechny registrační funkce nalezené v sestavení.

K získání sestavení použijte Assembly.Load .

Platí pro