Compartilhar via


RegistrationHelper.InstallAssembly Método

Definição

Fornece os componentes de tempo de execução disponíveis para o catálogo COM+.

Sobrecargas

InstallAssembly(String, String, String, InstallationFlags)

Instala o assembly nomeado em um aplicativo COM+.

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

Instala o assembly nomeado em um aplicativo COM+.

InstallAssembly(String, String, String, InstallationFlags)

Instala o assembly nomeado em um aplicativo 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

O nome de arquivo do assembly a ser instalado.

application
String

O nome do aplicativo COM+ no qual instalar. Esse parâmetro pode ser null. Se o parâmetro for null e o assembly contiver um ApplicationNameAttribute, o atributo será usado. Caso contrário, o nome do aplicativo será gerado com base no nome do assembly e, em seguida, será retornado.

tlb
String

O nome do arquivo de saída do Exportador da biblioteca de tipos (Tlbexp.exe) ou uma cadeia de caracteres que contém null se é esperado que o auxiliar de registro gere o nome. O nome real usado é colocado no parâmetro após a conclusão da chamada.

installFlags
InstallationFlags

Uma combinação bit a bit dos valores InstallationFlags.

Implementações

Exceções

O assembly de entrada não tem um nome forte.

Exemplos

O exemplo de código a seguir mostra como usar o InstalAssembly método para instalar um assembly nomeado em um aplicativo 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()

Comentários

InstallAssembly executa as seguintes etapas: registro, geração de uma biblioteca de tipos, registro da biblioteca de tipos, instalação da biblioteca de tipos no aplicativo especificado e configuração dos componentes contidos na biblioteca de tipos.

Esse método exige que o chamador tenha privilégios administrativos no computador local.

Aplica-se a

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

Instala o assembly nomeado em um aplicativo 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

O nome de arquivo do assembly a ser instalado.

application
String

O nome do aplicativo COM+ no qual instalar. Esse parâmetro pode ser null. Se o parâmetro for null e o assembly contiver um ApplicationNameAttribute, o atributo será usado. Caso contrário, o nome do aplicativo será gerado com base no nome do assembly e, em seguida, será retornado.

partition
String

O nome da partição. Esse parâmetro pode ser null.

tlb
String

O nome do arquivo de saída do Exportador da biblioteca de tipos (Tlbexp.exe) ou uma cadeia de caracteres que contém null se é esperado que o auxiliar de registro gere o nome. O nome real usado é colocado no parâmetro após a conclusão da chamada.

installFlags
InstallationFlags

Uma combinação bit a bit dos valores InstallationFlags.

Exceções

O assembly de entrada não tem um nome forte.

Comentários

InstallAssembly executa as seguintes etapas: registro, geração de uma biblioteca de tipos, registro da biblioteca de tipos, instalação da biblioteca de tipos no aplicativo especificado e configuração dos componentes contidos na biblioteca de tipos.

Esse método exige que o chamador tenha privilégios administrativos no computador local.

Aplica-se a