Debugger.Launch()、Trace.Assert(fail) 不起作用
(请注意,这个问题已在调试 Sharepoint 计时器作业中标记为答案,但我'我仍然遇到问题)
我无法调试我的 SharePoint 计时器作业。通常我可以通过设置以下之一来完成此操作:
Debugger.Launch()
Trace.Assert(false)
但不显示对话框。我有一个 log4net OutputDebugStringAppender
,这样我就可以使用 DebugView
来监视输出,并且我可以看到 DEBUG ASSERTION FAILED
正在被写入调试日志。我尝试删除附加程序,以防它可能弄乱某些东西,但没有运气。
(重建、重新启动、IIS 重置、服务重置、程序集中的 pdb 文件已完成)
那么为什么没有显示对话框?我确实需要一些帮助来调试这个计时器作业,并且非常感谢您的任何想法。
(Note, this question has been marked answered in Debugging Sharepoint timer jobs but I'm still having trouble)
I'm unable to debug my SharePoint timer job. Usually I can do this by setting one of these:
Debugger.Launch()
Trace.Assert(false)
But a dialog is not shown. I have a log4net OutputDebugStringAppender
so that I can use DebugView
to monitor output, and I can see that DEBUG ASSERTION FAILED
is being written to the debug log. I've tried removing the appender in case it might mess up something, but with no luck.
(Rebuild, restart, IIS reset, Service reset, pdb files in assembly is done)
So why is a dialog not shown? I could really use some help with debugging this timer job and would be very thankful for any ideas.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您很可能在调试模式而不是发布模式下运行应用程序。在调试模式下,您已经附加了调试器,因此它不会启动。
您可以通过以下方式找到调试器是否已附加:
所以尝试这样:
You are most probably running your app in Debug mode instead of Release mode. In debug mode you already have Debugger attached so it won't launch.
You can find if debugger is attached or not by this:
So try like this: