Freigeben über


RegistrationHelper.InstallAssemblyFromConfig-Methode

Installiert die benannte Assembly in einer COM+-Anwendung.

Namespace: System.EnterpriseServices
Assembly: System.EnterpriseServices (in system.enterpriseservices.dll)

Syntax

'Declaration
Public Sub InstallAssemblyFromConfig ( _
    ByRef regConfig As RegistrationConfig _
)
'Usage
Dim instance As RegistrationHelper
Dim regConfig As RegistrationConfig

instance.InstallAssemblyFromConfig(regConfig)
public void InstallAssemblyFromConfig (
    ref RegistrationConfig regConfig
)
public:
void InstallAssemblyFromConfig (
    RegistrationConfig^% regConfig
)
public void InstallAssemblyFromConfig (
    /** @ref */ RegistrationConfig regConfig
)
JScript unterstützt die Übergabe von Werttypargumenten als Verweis nicht.

Parameter

Hinweise

Bei dieser Methode muss der Aufrufer Administratorberechtigungen für den lokalen Computer besitzen.

Beispiel

Im folgenden Codebeispiel wird veranschaulicht, wie die InstalAssemblyFromConfig-Methode verwendet wird, 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
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)
// 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
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.set_AssemblyFile(
    "C:..\\..\\QueuedComponent.dll");
registrationConfiguration.set_Application("MyApp");
registrationConfiguration.set_InstallationFlags(InstallationFlags.
    CreateTargetApplication);
RegistrationHelper helperFromConfig = new RegistrationHelper();
helperFromConfig.InstallAssemblyFromConfig(registrationConfiguration);

.NET Framework-Sicherheit

  • Volle Vertrauenswürdigkeit für den unmittelbaren Aufrufer. Dieser Member kann von nur teilweise vertrauenswürdigem Code nicht verwendet werden. Weitere Informationen finden Sie unter .

Plattformen

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1

Siehe auch

Referenz

RegistrationHelper-Klasse
RegistrationHelper-Member
System.EnterpriseServices-Namespace