因为我已将我的代码迁移到.net 4.5,所以当我尝试使用eventID>编写eventLog时出错。 65535
这是我的代码,其中iID是> 65535:
System.Diagnostics.EventLog appLog = new System.Diagnostics.EventLog();
appLog.Source = "my source";
appLog.WriteEntry(sMsg, EventLogEntryType.Error, iID);
根据定义,eventID很好是一个int32所以我不明白为什么我会在那里得到错误。
这里是堆栈跟踪:
at System.Diagnostics.EventLogInternal.WriteEntry(String message, EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData)
at System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType type, Int32 eventID)
at WSeProcFilesHandler.EventLog_AddEntry(String sMsg, Int32 iID) in d:\Liox\TFS\Eprocurement\Main\Dev\Eprocurement\Services\WAeProcFilesHandler\WSeProcFilesHandler.cs:line 567
欢迎任何帮助。 感谢