RegistrationServices.RegisterAssembly Metoda

Definicja

Rejestruje klasy w zestawie zarządzanym, aby umożliwić tworzenie 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

Zestaw do zarejestrowania.

flags
AssemblyRegistrationFlags

Wartość wskazująca AssemblyRegistrationFlags wszystkie ustawienia specjalne używane podczas rejestrowania assemblyelementu .

Zwraca

true jeśli assembly zawiera typy, które zostały pomyślnie zarejestrowane; w przeciwnym razie false jeśli zestaw nie zawiera kwalifikujących się typów.

Implementuje

Atrybuty

Wyjątki

assembly to null.

Pełna nazwa to assemblynull.

-lub-

Metoda oznaczona znakiem ComRegisterFunctionAttribute nie staticjest .

-lub-

Istnieje więcej niż jedna metoda oznaczona ComRegisterFunctionAttribute na danym poziomie hierarchii.

-lub-

Podpis metody oznaczonej przy ComRegisterFunctionAttribute użyciu jest nieprawidłowy.

Funkcja rejestracji niestandardowej zdefiniowana przez użytkownika (oznaczona atrybutem ComRegisterFunctionAttribute ) zgłasza wyjątek.

Uwagi

RegisterAssembly Dodaje odpowiednie wpisy rejestru dla typów w określonym zestawie. Ta metoda wywołuje również wszystkie funkcje rejestracji znalezione w zestawie.

Użyj Assembly.Load polecenia , aby uzyskać zestaw.

Dotyczy