RegistrationServices.RegisterAssembly Méthode

Définition

Inscrit les classes dans un assembly managé pour activer la création à partir de 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

Paramètres

assembly
Assembly

Assembly à inscrire.

flags
AssemblyRegistrationFlags

Valeur AssemblyRegistrationFlags indiquant les paramètres spéciaux utilisés lors de l’inscription assembly.

Retours

true si assembly contient des types qui ont été correctement inscrits ; sinon false , si l’assembly ne contient aucun type éligible.

Implémente

Attributs

Exceptions

assembly a la valeur null.

Le nom complet est assemblynull.

-ou-

Une méthode marquée avec ComRegisterFunctionAttribute n’est pas static.

-ou-

Il existe plusieurs méthodes marquées avec ComRegisterFunctionAttribute un niveau donné de la hiérarchie.

-ou-

La signature de la méthode marquée avec ComRegisterFunctionAttribute n’est pas valide.

Une fonction d’inscription personnalisée définie par l’utilisateur (marquée avec l’attribut ComRegisterFunctionAttribute ) lève une exception.

Remarques

RegisterAssembly ajoute les entrées de Registre appropriées pour les types dans l’assembly spécifié. Cette méthode appelle également toutes les fonctions d’inscription trouvées dans l’assembly.

Permet Assembly.Load d’obtenir un assembly.

S’applique à