Nlog を使用してログを Eventlog に書き込もうとしています。これは私の Nlog.config の例です。
<target xsi:type="EventLog"
name="eventlog"
layout="${message}"
log="Application"
source="MyAppName" />
管理者権限で実行するInstallNlogConfig
と、次のエラーが表示されます。
NLog.NLogConfigurationException: EventLog Target [eventlog] の初期化中にエラーが発生しました - System.IO.IOException: ネットワーク パスが見つかりませんでした。
Microsoft.Win32.RegistryKey.Win32ErrorStatic(Int32 errorCode, String str) Microsoft.Win32.RegistryKey.OpenRemoteBaseKey(RegistryHive hKey, String machineName, RegistryView view) System.Diagnostics.EventLog.GetEventLogRegKey(String machine, Boolean writable) en System .Diagnostics.EventLog.FindSourceRegistration(String source, String machineName, Boolean readOnly, Boolean wantToCreate) ja System.Diagnostics.EventLog._InternalLogNameFromSourceName(String source, String machineName) ja System.Diagnostics.EventLog.LogNameFromSourceName(String source, String machineName) ja NLog.Targets.EventLogTarget.InitializeTarget() en c:\NLogBuild\src\NLog\Targets\EventLogTarget.cs:línea 175 en NLog.Targets.Target.Initialize(LoggingConfiguration configuration) en c:\NLogBuild\src\NLog\Targets \Target.cs:línea 288. 2013-06-10 12:21:05.0708 情報 ロギングをシャットダウンしています... 2013-06-10 12:21:05.0708 情報 ロガーがシャットダウンされました。