RegistrationHelper.InstallAssembly Metoda

Definicja

Udostępnia składniki czasu wykonywania dostępne dla katalogu COM+.

Przeciążenia

InstallAssembly(String, String, String, InstallationFlags)

Instaluje nazwany zestaw w aplikacji COM+.

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

Instaluje nazwany zestaw w aplikacji COM+.

InstallAssembly(String, String, String, InstallationFlags)

Instaluje nazwany zestaw w aplikacji 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)

Parametry

assembly
String

Nazwa pliku zestawu do zainstalowania.

application
String

Nazwa aplikacji COM+ do zainstalowania. Ten parametr może mieć wartość null. Jeśli parametr to null , a zestaw zawiera ApplicationNameAttributewartość , jest używany atrybut . W przeciwnym razie nazwa aplikacji jest generowana na podstawie nazwy zestawu, a następnie jest zwracana.

tlb
String

Nazwa pliku eksportera biblioteki typów wyjściowych (Tlbexp.exe) lub ciąg, który zawiera null , jeśli pomocnik rejestracji ma wygenerować nazwę. Rzeczywista używana nazwa jest umieszczana w parametrze po zakończeniu wywołania.

installFlags
InstallationFlags

Bitowa kombinacja InstallationFlags wartości.

Implementuje

Wyjątki

Zestaw wejściowy nie ma silnej nazwy.

Przykłady

W poniższym przykładzie kodu pokazano, jak za pomocą InstalAssembly metody zainstalować nazwany zestaw w aplikacji 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()

Uwagi

InstallAssembly Wykonuje następujące kroki: rejestracja, generowanie biblioteki typów, rejestracja biblioteki typów, instalacja biblioteki typów w ramach określonej aplikacji i konfiguracja składników zawartych w bibliotece typów.

Ta metoda wymaga, aby obiekt wywołujący miał uprawnienia administracyjne na komputerze lokalnym.

Dotyczy

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

Instaluje nazwany zestaw w aplikacji 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)

Parametry

assembly
String

Nazwa pliku zestawu do zainstalowania.

application
String

Nazwa aplikacji COM+ do zainstalowania. Ten parametr może mieć wartość null. Jeśli parametr to null , a zestaw zawiera ApplicationNameAttributewartość , jest używany atrybut . W przeciwnym razie nazwa aplikacji jest generowana na podstawie nazwy zestawu, a następnie jest zwracana.

partition
String

Nazwa partycji. Ten parametr może mieć wartość null.

tlb
String

Nazwa pliku eksportera biblioteki typów wyjściowych (Tlbexp.exe) lub ciąg, który zawiera null , jeśli pomocnik rejestracji ma wygenerować nazwę. Rzeczywista używana nazwa jest umieszczana w parametrze po zakończeniu wywołania.

installFlags
InstallationFlags

Bitowa kombinacja InstallationFlags wartości.

Wyjątki

Zestaw wejściowy nie ma silnej nazwy.

Uwagi

InstallAssembly Wykonuje następujące kroki: rejestracja, generowanie biblioteki typów, rejestracja biblioteki typów, instalacja biblioteki typów w ramach określonej aplikacji i konfiguracja składników zawartych w bibliotece typów.

Ta metoda wymaga, aby obiekt wywołujący miał uprawnienia administracyjne na komputerze lokalnym.

Dotyczy