RegistrationServices.RegisterAssembly Metoda

Definice

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

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

Parametry

assembly
Assembly

Sestavení, které se má zaregistrovat.

flags
AssemblyRegistrationFlags

Hodnota AssemblyRegistrationFlags označující všechna speciální nastavení použitá assemblypři registraci .

Návraty

true pokud assembly obsahuje typy, které byly úspěšně zaregistrovány; v opačném případě false , pokud sestavení neobsahuje žádné způsobilé typy.

Implementuje

Atributy

Výjimky

assembly je null.

Úplný název souboru assembly je null.

-nebo-

Metoda označená pomocí ComRegisterFunctionAttribute 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ý.

Uživatelem definovaná vlastní registrační funkce (označená atributem ComRegisterFunctionAttribute ) vyvolá výjimku.

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í.

Použijte Assembly.Load k získání sestavení.

Platí pro