System.Diagnostics.EventLogInstaller.MessageResourceFile Property

Gets or sets the path of the resource file that contains message formatting strings for the source.

Syntax

[System.Runtime.InteropServices.ComVisible(false)]
[System.ComponentModel.TypeConverter("System.Diagnostics.Design.StringValueConverter, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
[System.ComponentModel.Editor("System.Windows.Forms.Design.FileNameEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
public string MessageResourceFile { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

Use the EventLogInstaller.MessageResourceFile property to configure an event log source to write localized event messages. Event messages are application-defined strings that describe the event to the user.

Your application can write event log entries using resource identifiers. A resource identifier indexes a message located in the EventLogInstaller.MessageResourceFile. The Event Viewer uses the resource identifier to find and display the corresponding string from the localized resource file based on current language settings.

The event source must be configured either for writing localized entries or for writing direct strings. Use the erload:System.Diagnostics.EventLog.WriteEvent method to write localized entries for a source configured with a message resource file.

If your application writes event message strings directly, rather than using a resource identifier in a localized resource file, do not set the EventLogInstaller.MessageResourceFile property.

If the EventLog.MachineName property is not the local computer identifier ("."), the .NET Framework assumes that the resource file is on a remote computer. If the EventLogInstaller.MessageResourceFile property value contains a drive letter, the resource file is assumed to be on the \\<machinename>\<drive>$ share (for example, \\server\c$). If the value contains the string %systemroot%, the resource file is assumed to be on the \\<machinename>\admin$ share (for example, \\server\admin$).

For details about defining event messages and building event resource files, see the "Message Compiler" topic in the Platform SDK documentation at tp://msdn.microsoft.com/.

Requirements

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