RegistrationHelper.InstallAssembly Méthode

Définition

Fournit les composants runtime disponibles au catalogue COM+.

Surcharges

InstallAssembly(String, String, String, InstallationFlags)

Installe l’assembly nommé dans une application COM+.

InstallAssembly(String, String, String, String, InstallationFlags)

Installe l’assembly nommé dans une application COM+.

InstallAssembly(String, String, String, InstallationFlags)

Installe l’assembly nommé dans une application COM+.

public:
 virtual void InstallAssembly(System::String ^ assembly, System::String ^ % application, System::String ^ % tlb, System::EnterpriseServices::InstallationFlags installFlags);
public void InstallAssembly (string assembly, ref string application, ref string tlb, System.EnterpriseServices.InstallationFlags installFlags);
abstract member InstallAssembly : string * string * string * System.EnterpriseServices.InstallationFlags -> unit
override this.InstallAssembly : string * string * string * System.EnterpriseServices.InstallationFlags -> unit
Public Sub InstallAssembly (assembly As String, ByRef application As String, ByRef tlb As String, installFlags As InstallationFlags)

Paramètres

assembly
String

Nom de ficher de l’assembly à installer.

application
String

Nom de l’application COM+ dans laquelle l’assembly doit être installé. Ce paramètre peut être null. Si le paramètre est null et que l’assembly contient un ApplicationNameAttribute, l’attribut est utilisé. Sinon, le nom de l’application est généré à partir du nom de l’assembly, puis il est retourné.

tlb
String

Nom du fichier de sortie Type Library Exporter (Tlbexp.exe) ou bien chaîne égale à null si l’application d’assistance d’inscription doit générer le nom. Le nom actuellement utilisé est placé dans le paramètre à la fin de l’appel.

installFlags
InstallationFlags

Combinaison d'opérations de bits des valeurs InstallationFlags.

Implémente

Exceptions

L’assembly d’entrée ne possède pas de nom fort.

Exemples

L’exemple de code suivant montre comment utiliser la InstalAssembly méthode pour installer un assembly nommé dans une application COM+.

String^ applicationName = "Queued Component";
String^ typeLibraryName = nullptr;
RegistrationHelper^ helper = gcnew RegistrationHelper;
// Call the InstallAssembly method passing it the name of the assembly to 
// install as a COM+ application, the COM+ application name, and 
// the name of the type library file.
// Setting the application name and the type library to NULL (nothing in Visual Basic .NET
// allows you to use the COM+ application name that is given in the assembly and 
// the default type library name. The application name in the assembly metadata 
// takes precedence over the application name you provide to InstallAssembly. 
helper->InstallAssembly( "C:..\\..\\QueuedComponent.dll",  applicationName,  typeLibraryName, InstallationFlags::CreateTargetApplication );
Console::WriteLine( "Registration succeeded: Type library {0} created.", typeLibraryName );
Console::Read();
string applicationName = "Queued Component";			
string typeLibraryName = null;
RegistrationHelper helper = new RegistrationHelper();
// Call the InstallAssembly method passing it the name of the assembly to
// install as a COM+ application, the COM+ application name, and
// the name of the type library file.
// Setting the application name and the type library to NULL (nothing in Visual Basic .NET
// allows you to use the COM+ application name that is given in the assembly and
// the default type library name. The application name in the assembly metadata
// takes precedence over the application name you provide to InstallAssembly.
helper.InstallAssembly(@"C:..\..\QueuedComponent.dll", ref applicationName, ref typeLibraryName, InstallationFlags.CreateTargetApplication);
Console.WriteLine("Registration succeeded: Type library {0} created.", typeLibraryName);
Console.Read();
Dim applicationName As String = "Queued Component"
Dim typeLibraryName As String = Nothing
Dim helper As New RegistrationHelper

' Call the InstallAssembly method passing it the name of the assembly to 
' install as a COM+ application, the COM+ application name, and 
' the name of the type library file.
' Setting the application name and the type library to NULL (nothing in Visual Basic .NET
' allows you to use the COM+ application name that is given in the assembly and 
' the default type library name. The application name in the assembly metadata 
' takes precedence over the application name you provide to InstallAssembly. 
helper.InstallAssembly("C:..\..\QueuedComponent.dll", applicationName, typeLibraryName, InstallationFlags.CreateTargetApplication)
MsgBox("Registration succeeded: Type library " & typeLibraryName & " created.")
Console.Read()

Remarques

InstallAssembly Effectue les étapes suivantes : inscription, génération d’une bibliothèque de types, inscription de la bibliothèque de types, installation de la bibliothèque de types sous l’application spécifiée et configuration des composants contenus dans la bibliothèque de types.

Cette méthode nécessite que l’appelant dispose de privilèges d’administration sur l’ordinateur local.

S’applique à

InstallAssembly(String, String, String, String, InstallationFlags)

Installe l’assembly nommé dans une application COM+.

public:
 void InstallAssembly(System::String ^ assembly, System::String ^ % application, System::String ^ partition, System::String ^ % tlb, System::EnterpriseServices::InstallationFlags installFlags);
public void InstallAssembly (string assembly, ref string application, string partition, ref string tlb, System.EnterpriseServices.InstallationFlags installFlags);
member this.InstallAssembly : string * string * string * string * System.EnterpriseServices.InstallationFlags -> unit
Public Sub InstallAssembly (assembly As String, ByRef application As String, partition As String, ByRef tlb As String, installFlags As InstallationFlags)

Paramètres

assembly
String

Nom de ficher de l’assembly à installer.

application
String

Nom de l’application COM+ dans laquelle l’assembly doit être installé. Ce paramètre peut être null. Si le paramètre est null et que l’assembly contient un ApplicationNameAttribute, l’attribut est utilisé. Sinon, le nom de l’application est généré à partir du nom de l’assembly, puis il est retourné.

partition
String

Nom de la partition. Ce paramètre peut être null.

tlb
String

Nom du fichier de sortie Type Library Exporter (Tlbexp.exe) ou bien chaîne égale à null si l’application d’assistance d’inscription doit générer le nom. Le nom actuellement utilisé est placé dans le paramètre à la fin de l’appel.

installFlags
InstallationFlags

Combinaison d'opérations de bits des valeurs InstallationFlags.

Exceptions

L’assembly d’entrée ne possède pas de nom fort.

Remarques

InstallAssembly Effectue les étapes suivantes : inscription, génération d’une bibliothèque de types, inscription de la bibliothèque de types, installation de la bibliothèque de types sous l’application spécifiée et configuration des composants contenus dans la bibliothèque de types.

Cette méthode nécessite que l’appelant dispose de privilèges d’administration sur l’ordinateur local.

S’applique à