[英]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.