.NET 应用程序仅在发布模式下挂起,有时......:-(
在我们的程序中,您可以从列表中选择文档类型。然后单击“确定”,或双击所选项目,将创建并显示一个新文档。
现在的问题是,有时,仅在发布模式下,当您双击某个项目时,应用程序会挂起。你仍然可以移动窗户,一切都重新粉刷得很好,但就是没有任何反应...... 当处于调试模式时,根本没有问题......而且,大多数时候一切都工作正常??? 没有显示错误信息...我们所能做的就是终止进程...
我们如何找出导致挂起的原因?
In our program, you can select a document type from a list. You then click OK, or double-click the selected item, and a new document is created and shown.
Now the problem is that SOMETIMES, in release mode only, when you double-click an item, the app hangs. You can still move windows, and all is repainted fine, but there's just no response whatsoever ...
When in debug mode, there's no problem at all ... Also, most of the time everything works fine ???
There is no error information shown ... all we can do is terminate the process ...
How can we find out what's causing the hang?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您介绍了一些日志记录吗?例如,您可以使用 log4net 来执行此操作。与 PostSharp 结合使用,您可以快速为所有方法入口/出口添加一些日志记录,并查看是否发生了奇怪的情况上。
(甚至有一个名为 Log4PostSharp 的项目,但我从来没有尝试了一下)。
Did you introduce some logging? You can use for instance log4net to do so. In combination with PostSharp you can quickly add some logging for all method entries/exits and see if something weired is going on.
(There is even a project called Log4PostSharp, but I never gave it a try).
在 Visual Studio 中,使用“工具”+“附加到进程”并选择您的程序。如有必要,请使用“调试”+“Windows”+“线程”来选择线程。 Debug + Break All,查看调用堆栈,看看哪里死锁了。
In Visual Studio, use Tools + Attach to Process and select your program. If necessary, use Debug + Windows + Threads to select a thread. Debug + Break All, look at the call stack to see where it is deadlocked.