RegistrationServices.RegisterAssembly Metoda
Definicja
Ważne
Niektóre informacje odnoszą się do produktu w wersji wstępnej, który może zostać znacząco zmodyfikowany przed wydaniem. Firma Microsoft nie udziela żadnych gwarancji, jawnych lub domniemanych, w odniesieniu do informacji podanych w tym miejscu.
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.
Wartość AssemblyRegistrationFlags wskazująca wszystkie ustawienia specjalne używane podczas rejestrowania assembly .
Zwraca
true jeśli assembly zawiera typy, które zostały pomyślnie zarejestrowane; w przeciwnym false razie, jeśli zestaw nie zawiera kwalifikujących się typów.
Implementuje
- Atrybuty
Wyjątki
assembly to null.
Pełna nazwa to assembly null .
-lub-
Metoda oznaczona za pomocą ComRegisterFunctionAttribute metody nie jest metodą static .
-lub- Istnieje więcej niż jedna metoda oznaczona ComRegisterFunctionAttribute za pomocą metody na danym poziomie hierarchii.
-lub- Podpis metody oznaczonej za pomocą ComRegisterFunctionAttribute jest nieprawidłowy.
Niestandardowa funkcja rejestracji zdefiniowana przez użytkownika (oznaczona za pomocą ComRegisterFunctionAttribute atrybutu) 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 , aby pobrać zestaw.