我有一个托管在 IIS 上的 ASP.net 网站,代码调用:
System.Diagnostics.Trace.WriteLine("test");
提醒:您使用Trace而不是Debug,因为Debug需要调试版本。而Trace始终有效1
所以在生产网络服务器上,我运行DbgView
,我没有看到 OutputDebugString 消息。
为什么我做错了?
DefaultTraceListener已经自动将消息输出为OutputDebugString:
默认情况下,Write和WriteLine方法将消息发送到 Win32 OutputDebugString函数和Debugger.Log方法。
我究竟做错了什么?
DefaultTraceListener是默认的跟踪侦听器。它是默认添加的。默认情况下,它将文本输出为OutputDebugString。对于和笑声,我可以尝试再次将其添加到web.config
:
<system.diagnostics>
<trace autoflush="false" indentsize="3">
<listeners>
<add name="defaultListener" type="System.Diagnostics.DefaultTraceListener" />
</listeners>
</trace>
</system.diagnostics>
但这无济于事。我究竟做错了什么?
我以管理员身份运行DebugView 。
我还上交了Capture Global,因为一些货物崇拜程序说这有帮助:
但这无济于事。我究竟做错了什么?
奖金阅读
- 在 WPF 应用程序中使用 System.Diagnostics.Trace 和 DbgView
- 使用 DbgView 从应用程序中捕获调试跟踪
- 使用 sysinternals 工具收集 .NET 应用程序跟踪
- 如何使 DebugView 在 .NET 4 下工作?
- 如何让 Debug.WriteLine 与其他进程一起工作?
- 如何从 ASP.net 网站写入 OutputDebugString?
1不工作