RegistrationHelper.InstallAssembly Method

Definition

Provides the run-time components available to the COM+ catalog.

Overloads

InstallAssembly(String, String, String, InstallationFlags)

Installs the named assembly in a COM+ application.

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

Installs the named assembly in a COM+ application.

InstallAssembly(String, String, String, InstallationFlags)

Installs the named assembly in a COM+ application.

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)

Parameters

assembly
String

The file name of the assembly to install.

application
String

The name of the COM+ application to install into. This parameter can be null. If the parameter is null and the assembly contains a ApplicationNameAttribute, then the attribute is used. Otherwise, the name of the application is generated based on the name of the assembly, then is returned.

tlb
String

The name of the output Type Library Exporter (Tlbexp.exe) file, or a string that contains null if the registration helper is expected to generate the name. The actual name used is placed in the parameter on call completion.

installFlags
InstallationFlags

A bitwise combination of the InstallationFlags values.

Implements

Exceptions

The input assembly does not have a strong name.

Examples

The following code example shows how to use the InstalAssembly method to install a named assembly in a COM+ application.

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

Remarks

InstallAssembly performs the following steps: registration, generation of a type library, registration of the type library, installation of the type library under the specified application, and configuration of the components contained in the type library.

This method requires the caller to have administrative privileges on the local computer.

Applies to

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

Installs the named assembly in a COM+ application.

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)

Parameters

assembly
String

The file name of the assembly to install.

application
String

The name of the COM+ application to install into. This parameter can be null. If the parameter is null and the assembly contains a ApplicationNameAttribute, then the attribute is used. Otherwise, the name of the application is generated based on the name of the assembly, then is returned.

partition
String

The name of the partition. This parameter can be null.

tlb
String

The name of the output Type Library Exporter (Tlbexp.exe) file, or a string that contains null if the registration helper is expected to generate the name. The actual name used is placed in the parameter on call completion.

installFlags
InstallationFlags

A bitwise combination of the InstallationFlags values.

Exceptions

The input assembly does not have a strong name.

Remarks

InstallAssembly performs the following steps: registration, generation of a type library, registration of the type library, installation of the type library under the specified application, and configuration of the components contained in the type library.

This method requires the caller to have administrative privileges on the local computer.

Applies to