次のコードを使用して、Windows イベント ログをエクスポートします。
var els = new EventLogSession();
els.ExportLogAndMessages("Application",
PathType.LogName,
"*[System[Provider[@Name='Prayon.Client']]]",
tempEventLogPath,
false,
CultureInfo.CurrentCulture);
これは一般的に機能しています。しかし、あるマシンでは、以下の例外が発生します。
System.Diagnostics.Eventing.Reader.EventLogException: Der Verzeichnisname ist ungültig
bei System.Diagnostics.Eventing.Reader.EventLogException.Throw(Int32 errorCode)
bei System.Diagnostics.Eventing.Reader.NativeWrapper.EvtArchiveExportedLog(EventLogHandle session, String logFilePath, Int32 locale, Int32 flags)
bei System.Diagnostics.Eventing.Reader.EventLogSession.ExportLogAndMessages(String path, PathType pathType, String query, String targetFilePath, Boolean tolerateQueryErrors, CultureInfo targetCultureInfo)
"Der Verzeichnisname ist ungültig"
英語での意味:"The pathname is invalid"
Application-EventLog は存在し、tempEventLogPath
有効です。
誰かが知っていますか、何が間違っている可能性がありますか?