Export (0) Print
Expand All

EventLogInstaller::CopyFromComponent Method

Copies the property values of an EventLog component that are required at installation time for an event log.

Namespace:  System.Diagnostics
Assembly:  System.Configuration.Install (in System.Configuration.Install.dll)

virtual void CopyFromComponent(
	IComponent^ component
) override


Type: System.ComponentModel::IComponent

An IComponent to use as a template for the EventLogInstaller.


The specified component is not an EventLog.


The Log or Source property of the specified component is either nullptr or empty.

The component specified by the component parameter must be an EventLog; otherwise, an exception is thrown.

Typically, you do not call the methods of the EventLogInstaller from within your code; they are generally called only by the Installutil.exe (Installer Tool). CopyFromComponent is used by Installutil.exe to set the property values for the EventLogInstaller to the values of an existing EventLog.

If the Log of the EventLog that is passed in is an empty string (""), you must set the Log property to a valid value before the installer executes.

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

© 2014 Microsoft