RegistrationHelper.InstallAssembly Метод

Определение

Представляет компоненты времени выполнения, доступные в каталоге COM+.

Перегрузки

InstallAssembly(String, String, String, InstallationFlags)

Устанавливает именованную сборку в приложении COM+.

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

Устанавливает именованную сборку в приложении COM+.

InstallAssembly(String, String, String, InstallationFlags)

Устанавливает именованную сборку в приложении 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)

Параметры

assembly
String

Имя файла устанавливаемой сборки.

application
String

Имя приложения COM+, в которое осуществляется установка. Этот параметр может иметь значение null. Атрибут используется, если параметр имеет значение null и сборка содержит объект ApplicationNameAttribute. В противном случае, имя приложения создается на основе имени сборки, а затем возвращается.

tlb
String

Имя выходного файла инструмента для экспорта библиотек типов (Tlbexp.exe) или строка, содержащая значение null, если предполагается, что имя создается помощником регистрации. При завершении вызова параметру присваивается фактическое имя.

installFlags
InstallationFlags

Поразрядное сочетание значений InstallationFlags.

Реализации

Исключения

Входная сборка не имеет строгого имени.

Примеры

В следующем примере кода показано, как использовать InstalAssembly метод для установки именованной сборки в приложении 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()

Комментарии

InstallAssembly выполняет следующие действия: регистрация, создание библиотеки типов, регистрация библиотеки типов, установка библиотеки типов в указанном приложении и настройка компонентов, содержащихся в библиотеке типов.

Этот метод требует, чтобы вызывающий объект был иметь права администратора на локальном компьютере.

Применяется к

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

Устанавливает именованную сборку в приложении 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)

Параметры

assembly
String

Имя файла устанавливаемой сборки.

application
String

Имя приложения COM+, в которое осуществляется установка. Этот параметр может иметь значение null. Атрибут используется, если параметр имеет значение null и сборка содержит объект ApplicationNameAttribute. В противном случае, имя приложения создается на основе имени сборки, а затем возвращается.

partition
String

Имя секции. Этот параметр может иметь значение null.

tlb
String

Имя выходного файла инструмента для экспорта библиотек типов (Tlbexp.exe) или строка, содержащая значение null, если предполагается, что имя создается помощником регистрации. При завершении вызова параметру присваивается фактическое имя.

installFlags
InstallationFlags

Поразрядное сочетание значений InstallationFlags.

Исключения

Входная сборка не имеет строгого имени.

Комментарии

InstallAssembly выполняет следующие действия: регистрация, создание библиотеки типов, регистрация библиотеки типов, установка библиотеки типов в указанном приложении и настройка компонентов, содержащихся в библиотеке типов.

Этот метод требует, чтобы вызывающий объект был иметь права администратора на локальном компьютере.

Применяется к