RegistrationHelper.InstallAssemblyFromConfig(RegistrationConfig) 方法

定义

在 COM+ 应用程序中安装命名的程序集。

public:
 void InstallAssemblyFromConfig(System::EnterpriseServices::RegistrationConfig ^ % regConfig);
public void InstallAssemblyFromConfig (ref System.EnterpriseServices.RegistrationConfig regConfig);
member this.InstallAssemblyFromConfig : RegistrationConfig -> unit
Public Sub InstallAssemblyFromConfig (ByRef regConfig As RegistrationConfig)

参数

regConfig
RegistrationConfig

标识要安装的程序集的 RegistrationConfig

示例

下面的代码示例演示如何使用 InstalAssemblyFromConfig 方法在 COM+ 应用程序中安装命名程序集。

// Create a RegistrationConfig object and set its attributes
// Create a RegistrationHelper object, and call the InstallAssemblyFromConfig
// method by passing the RegistrationConfiguration object to it as a 
// reference object
RegistrationConfig^ registrationConfiguration = gcnew RegistrationConfig;
registrationConfiguration->AssemblyFile = "C:..\\..\\QueuedComponent.dll";
registrationConfiguration->Application = "MyApp";
registrationConfiguration->InstallationFlags = InstallationFlags::CreateTargetApplication;
RegistrationHelper^ helperFromConfig = gcnew RegistrationHelper;
helperFromConfig->InstallAssemblyFromConfig(  registrationConfiguration );
// Create a RegistrationConfig object and set its attributes
// Create a RegistrationHelper object, and call the InstallAssemblyFromConfig
// method by passing the RegistrationConfiguration object to it as a
// reference object
RegistrationConfig registrationConfiguration = new RegistrationConfig();
registrationConfiguration.AssemblyFile=@"C:..\..\QueuedComponent.dll";
registrationConfiguration.Application = "MyApp";
registrationConfiguration.InstallationFlags = InstallationFlags.CreateTargetApplication;
RegistrationHelper helperFromConfig = new RegistrationHelper();
helperFromConfig.InstallAssemblyFromConfig(ref registrationConfiguration);
' Create a RegistrationConfig object and set its attributes
' Create a RegistrationHelper object, and call the InstallAssemblyFromConfig
' method by passing the RegistrationConfiguration object to it as a 
' reference object
Dim registrationConfiguration As New RegistrationConfig()
registrationConfiguration.AssemblyFile = "C:..\..\QueuedComponent.dll"
registrationConfiguration.Application = "MyApp"
registrationConfiguration.InstallationFlags = InstallationFlags.CreateTargetApplication
Dim helperFromConfig As New RegistrationHelper()
helperFromConfig.InstallAssemblyFromConfig(registrationConfiguration)

注解

此方法要求调用方在本地计算机上具有管理权限。

适用于