![](/img/trans.png)
[英]The description for Event ID 'x' in Source 'y' cannot be found. Reading 'System' event logs from eventvwr C#
[英]Writing to EventLog from Windows 8.1, message saying “The description for Event ID 0 from source cannot be found.”
我正在Windows 8.1版本6.3.9600上運行此程序,我真的需要一些最基本的簡化應用程序的幫助,這些應用程序可以寫入事件日志。 這是我的代碼:
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
EventLog.WriteEntry("Testing Application", "Testing data", EventLogEntryType.Information, 100);
}
}
}
執行后,我得到一個異常 :
and add value with data then there is no exception, but the event entry displays all this: 但是,如果我添加注冊表項並添加帶有數據 ,則沒有例外,但是事件條目顯示所有這些:
我有什么辦法可以在事件日志中僅顯示文本“ Testing data”? 還是Windows 8.1工作方式不同,我不知道嗎?
親切的問候
達姆揚
您需要為事件查看器設置消息文件。 看看找不到源事件ID的描述
簽出此答案,它確實滿足您的需要(編寫事件日志條目,而不會出現“找不到描述”錯誤,並且無需注冊自定義事件源
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.