如何在DbgView中查看System.Diagnostics.Trace.WriteLine输出?
我有一个托管在 IIS 上的 ASP.net 网站,代码调用:
System.Diagnostics.Trace.WriteLine("test");
提醒:您使用 Trace,而不是 Debug,因为 Debug 需要调试版本。而 Trace 始终有效1
因此,在生产网络服务器上,我运行 DbgView
,但没有看到 OutputDebugString消息。
为什么我做错了?
DefaultTraceListener 已经自动将消息输出为 OutputDebugString:
默认情况下,写和WriteLine 方法发出发送至 Win32 OutputDebugString 函数和 Debugger.Log 方法。
我做错了什么?
DefaultTraceListener 是默认的跟踪侦听器。默认情况下会添加它。默认情况下,它将文本输出为 OutputDebugString。对于
I have an ASP.net web-site hosted on IIS, and the code calls:
System.Diagnostics.Trace.WriteLine("test");
Reminder: You use Trace, rather than Debug, because Debug requires a debug build. Whereas Trace always works1
So on the production web-server, i run DbgView
, and i don't see the OutputDebugString messages.
Why am i doing wrong?
The DefaultTraceListener already automatically outputs the messages as OutputDebugString:
By default, the Write and WriteLine methods emit the message to the Win32 OutputDebugString function and to the Debugger.Log method.
What am i doing wrong?
The DefaultTraceListener is the default trace listener. It is added by default. And by default it outputs text as OutputDebugString. For ???? and laughter, i can try adding it again to the web.config
:
<system.diagnostics>
<trace autoflush="false" indentsize="3">
<listeners>
<add name="defaultListener" type="System.Diagnostics.DefaultTraceListener" />
</listeners>
</trace>
</system.diagnostics>
But it doesn't help. What am i doing wrong?
I'm running DebugView as an administrator.
I also turned in Capture Global, because some cargo-cult programming says that helps:
But it doesn't help. What am i doing wrong?
Bonus Reading
- Use System.Diagnostics.Trace and DbgView within a WPF-Application
- Using DbgView To Capture Debug Traces From An Application
- Collect .NET applications traces with sysinternals tools
- How to make DebugView work under .NET 4?
- How to get Debug.WriteLine to work with other processes?
- How to write to OutputDebugString from ASP.net web-site?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论