RegistrationHelper.InstallAssembly Método

Definición

Suministra los componentes en tiempo de ejecución disponibles al catálogo de COM+.

Sobrecargas

InstallAssembly(String, String, String, InstallationFlags)

Instala el ensamblado en una aplicación de COM+.

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

Instala el ensamblado en una aplicación de COM+.

InstallAssembly(String, String, String, InstallationFlags)

Instala el ensamblado en una aplicación de 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)

Parámetros

assembly
String

Nombre de archivo del ensamblado que se va a instalar.

application
String

Nombre de la aplicación COM+ en la que se va a instalar. Este parámetro puede ser null. Si el valor del parámetro es null y el ensamblado contiene ApplicationNameAttribute, se utiliza el atributo. En caso contrario, el nombre de la aplicación se genera a partir del nombre del ensamblado y, a continuación, se devuelve.

tlb
String

Nombre del archivo del Exportador de la biblioteca de tipos resultante (Tlbexp.exe) o cadena que contiene null si se espera que sea la función del asistente de registro la que genere el nombre. El nombre real se coloca en el parámetro al completarse la llamada.

installFlags
InstallationFlags

Combinación bit a bit de los valores de InstallationFlags.

Implementaciones

Excepciones

El ensamblado de entrada no dispone de un nombre seguro.

Ejemplos

En el ejemplo de código siguiente se muestra cómo usar el InstalAssembly método para instalar un ensamblado con nombre en una aplicación 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()

Comentarios

InstallAssembly realiza los pasos siguientes: registro, generación de una biblioteca de tipos, registro de la biblioteca de tipos, instalación de la biblioteca de tipos en la aplicación especificada y configuración de los componentes contenidos en la biblioteca de tipos.

Este método requiere que el autor de la llamada tenga privilegios administrativos en el equipo local.

Se aplica a

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

Instala el ensamblado en una aplicación de 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)

Parámetros

assembly
String

Nombre de archivo del ensamblado que se va a instalar.

application
String

Nombre de la aplicación COM+ en la que se va a instalar. Este parámetro puede ser null. Si el valor del parámetro es null y el ensamblado contiene ApplicationNameAttribute, se utiliza el atributo. En caso contrario, el nombre de la aplicación se genera a partir del nombre del ensamblado y, a continuación, se devuelve.

partition
String

Nombre de la partición. Este parámetro puede ser null.

tlb
String

Nombre del archivo del Exportador de la biblioteca de tipos resultante (Tlbexp.exe) o cadena que contiene null si se espera que sea la función del asistente de registro la que genere el nombre. El nombre real se coloca en el parámetro al completarse la llamada.

installFlags
InstallationFlags

Combinación bit a bit de los valores de InstallationFlags.

Excepciones

El ensamblado de entrada no dispone de un nombre seguro.

Comentarios

InstallAssembly realiza los pasos siguientes: registro, generación de una biblioteca de tipos, registro de la biblioteca de tipos, instalación de la biblioteca de tipos en la aplicación especificada y configuración de los componentes contenidos en la biblioteca de tipos.

Este método requiere que el autor de la llamada tenga privilegios administrativos en el equipo local.

Se aplica a