Freigeben über


RegistrationHelper.InstallAssemblyFromConfig(RegistrationConfig) Methode

Definition

Installiert die benannte Assembly in einer COM+-Anwendung.

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)

Parameter

regConfig
RegistrationConfig

Eine RegistrationConfig, die die zu installierende Assembly bezeichnet.

Beispiele

Im folgenden Codebeispiel wird gezeigt, wie Sie die InstalAssemblyFromConfig -Methode verwenden, um eine benannte Assembly in einer COM+-Anwendung zu installieren.

// 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)

Hinweise

Diese Methode erfordert, dass der Aufrufer über Administratorrechte auf dem lokalen Computer verfügt.

Gilt für: