[英]Filter custom message from Visual Studio 2015 output window
在過去幾個月的某些時候,很多信息都是如此
Event 7 was called with 5 argument(s) , but it is defined with 6 paramenter(s).
Event 10 was called with 5 argument(s) , but it is defined with 6 paramenter(s).
Event 10 was called with 5 argument(s) , but it is defined with 6 paramenter(s).
開始向我的Visual Studio輸出窗口發送垃圾郵件,這使得很難找到實際的跟蹤和調試消息。 這些消息來自何處,以及如何禁用它們?
為了解決這個問題,我嘗試了幾件事。
TraceListener
並在Write
和WriteLine
方法中設置一個斷點,希望調用堆棧能告訴我從哪里生成消息。 我發現這些消息並非來自典型的Diagnotics.Debug
或Diagnotics.Trace
方法。 Console.SetOut()
將控制台重定向到自定義TextWriter
,我可以在其中設置斷點。 再一次,我找不到任何東西。 任何幫助,將不勝感激。
我發現這個字符串來自的組件,但還沒有如何或在哪里。
它位於原始dll(32位版本)中的mscorlib.dll行54673中:使用{1}參數調用事件{0},但它使用{2}參數定義
它來自資源名稱值對,這個名稱為EventSource_EventParametersMismatch
這是在system \\ diagnostics \\ eventing \\ eventsource.cs中使用的.WriteToAllListeners https://referencesource.microsoft.com/#mscorlib/system/diagnostics/eventing/eventsource.cs,7c04b58f26d81951
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.