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)

public override void CopyFromComponent (
	IComponent component
public void CopyFromComponent (
	IComponent component
public override function CopyFromComponent (
	component : IComponent



An IComponent to use as a template for the EventLogInstaller.

Exception typeCondition


The specified component is not an EventLog.


The Log or Source property of the specified component is either a null reference (Nothing in Visual Basic) 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 Installer Tool (Installutil.exe). 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.

  • Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see .

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

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

.NET Framework

Supported in: 2.0, 1.1, 1.0