RegistrationHelper.InstallAssembly Methode

Definition

Stellt die Laufzeitkomponenten bereit, die für den COM+-Katalog verfügbar sind.

Überlädt

Name Beschreibung
InstallAssembly(String, String, String, InstallationFlags)

Installiert die benannte Assembly in einer COM+-Anwendung.

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

Installiert die benannte Assembly in einer COM+-Anwendung.

InstallAssembly(String, String, String, InstallationFlags)

Installiert die benannte Assembly in einer COM+-Anwendung.

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)

Parameter

assembly
String

Der Dateiname der zu installierenden Assembly.

application
String

Der Name der zu installierenden COM+-Anwendung. Dieser Parameter kann null sein. Wenn der Parameter ist null und die Assembly ein ApplicationNameAttribute, dann wird das Attribut verwendet. Andernfalls wird der Name der Anwendung basierend auf dem Namen der Assembly generiert und dann zurückgegeben.

tlb
String

Der Name der Ausgabedatei des Typbibliotheksexporteurs (Tlbexp.exe) oder eine Zeichenfolge, die enthält null , wenn das Registrierungshilfsprogramm den Namen generieren soll. Der tatsächliche verwendete Name wird im Parameter beim Abschluss des Aufrufs platziert.

installFlags
InstallationFlags

Eine bitweise Kombination der InstallationFlags Werte.

Implementiert

Ausnahmen

Die Eingabeassembly hat keinen starken Namen.

Beispiele

Im folgenden Codebeispiel wird gezeigt, wie Sie die InstalAssembly Methode verwenden, um eine benannte Assembly in einer COM+-Anwendung zu installieren.

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()

Hinweise

InstallAssembly führt die folgenden Schritte aus: Registrierung, Generierung einer Typbibliothek, Registrierung der Typbibliothek, Installation der Typbibliothek unter der angegebenen Anwendung und Konfiguration der in der Typbibliothek enthaltenen Komponenten.

Für diese Methode muss der Aufrufer über Administratorrechte auf dem lokalen Computer verfügen.

Gilt für:

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

Installiert die benannte Assembly in einer COM+-Anwendung.

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)

Parameter

assembly
String

Der Dateiname der zu installierenden Assembly.

application
String

Der Name der zu installierenden COM+-Anwendung. Dieser Parameter kann null sein. Wenn der Parameter ist null und die Assembly ein ApplicationNameAttribute, dann wird das Attribut verwendet. Andernfalls wird der Name der Anwendung basierend auf dem Namen der Assembly generiert und dann zurückgegeben.

partition
String

Der Name der Partition. Dieser Parameter kann null sein.

tlb
String

Der Name der Ausgabedatei des Typbibliotheksexporteurs (Tlbexp.exe) oder eine Zeichenfolge, die enthält null , wenn das Registrierungshilfsprogramm den Namen generieren soll. Der tatsächliche verwendete Name wird im Parameter beim Abschluss des Aufrufs platziert.

installFlags
InstallationFlags

Eine bitweise Kombination der InstallationFlags Werte.

Ausnahmen

Die Eingabeassembly hat keinen starken Namen.

Hinweise

InstallAssembly führt die folgenden Schritte aus: Registrierung, Generierung einer Typbibliothek, Registrierung der Typbibliothek, Installation der Typbibliothek unter der angegebenen Anwendung und Konfiguration der in der Typbibliothek enthaltenen Komponenten.

Für diese Methode muss der Aufrufer über Administratorrechte auf dem lokalen Computer verfügen.

Gilt für: