RegistrationHelper.InstallAssembly RegistrationHelper.InstallAssembly RegistrationHelper.InstallAssembly RegistrationHelper.InstallAssembly Method

Definition

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

Overloads

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

Installs the named assembly in a COM+ application.

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

Installs the named assembly in a COM+ application.

InstallAssembly(String, String, String, InstallationFlags) InstallAssembly(String, String, String, InstallationFlags) InstallAssembly(String, String, String, InstallationFlags) 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 *  *  * System.EnterpriseServices.InstallationFlags -> unit
override this.InstallAssembly : 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 String String String

The file name of the assembly to install.

application
String String String 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 String String 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.

Implements

Exceptions

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.

Security

SecurityPermission
for the ability to access unmanaged code. Associated enumeration: UnmanagedCode

RegistryPermission
for the ability to access the registry. Associated enumeration: Unrestricted

InstallAssembly(String, String, String, String, InstallationFlags) InstallAssembly(String, String, String, String, InstallationFlags) InstallAssembly(String, String, String, String, InstallationFlags) 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 *  * 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 String String String

The file name of the assembly to install.

application
String String String 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 String String String

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

tlb
String String String 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.

Exceptions

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.

Security

SecurityPermission
for the ability to access unmanaged code. Associated enumeration: UnmanagedCode

RegistryPermission
for the ability to access the registry. Associated enumeration: Unrestricted

Applies to