My Visiual studio hangs all of a sudden when debugging the windows application. It's takes while to repond and but it's closing my application. I keep getting this issue everytime in every debugging session.
调试Windows应用程序时,我的Visiual工作室突然挂起。这需要一段时间来响应,但它正在关闭我的应用程序。我每次调试会话中都会不断收到此问题。
Please help to fix this problem.
请帮忙解决这个问题。
1 个解决方案
#1
Your application also stops responding right? If so, I presume that your application is giving VS problems. Presumably because some operation is tying up the main thread. When that is tied up no other events can be processed (button clicks, screen redrawing, close buttons, etc). That could be caused by an infinitive loop, or perhaps Disk IO or waiting for a network connection or a database query result, or a deadlock.
您的应用程序也停止响应吗?如果是这样,我认为你的应用程序正在给出VS问题。大概是因为某些操作正在捆绑主线程。当它被束缚时,不能处理其他事件(按钮点击,屏幕重绘,关闭按钮等)。这可能是由一个不确定的循环,或者可能是磁盘IO或等待网络连接或数据库查询结果或死锁引起的。
My suggestion would be to do some type of logging so you can identify where the problem is at. For instance, put a breakpoint at the top and bottom of major functions. After you break at the top one, hit play. If you don't hit the bottom one you know that the problem is somewhere in that area.
我的建议是进行某种类型的日志记录,以便您可以确定问题所在。例如,在主要函数的顶部和底部放置一个断点。在你打破顶部之后,点击播放。如果你没有触及底部,你知道问题出在该区域的某个地方。
Or, do some sort of logging like putting Console.WriteLn("Entering MyFunction()") at various places in the code.
或者,执行某种日志记录,例如将Console.WriteLn(“Entering MyFunction()”)放在代码中的不同位置。
Once you know where the problem is at, you can fix it.
一旦你知道问题出在哪里,你就可以解决它。
#1
Your application also stops responding right? If so, I presume that your application is giving VS problems. Presumably because some operation is tying up the main thread. When that is tied up no other events can be processed (button clicks, screen redrawing, close buttons, etc). That could be caused by an infinitive loop, or perhaps Disk IO or waiting for a network connection or a database query result, or a deadlock.
您的应用程序也停止响应吗?如果是这样,我认为你的应用程序正在给出VS问题。大概是因为某些操作正在捆绑主线程。当它被束缚时,不能处理其他事件(按钮点击,屏幕重绘,关闭按钮等)。这可能是由一个不确定的循环,或者可能是磁盘IO或等待网络连接或数据库查询结果或死锁引起的。
My suggestion would be to do some type of logging so you can identify where the problem is at. For instance, put a breakpoint at the top and bottom of major functions. After you break at the top one, hit play. If you don't hit the bottom one you know that the problem is somewhere in that area.
我的建议是进行某种类型的日志记录,以便您可以确定问题所在。例如,在主要函数的顶部和底部放置一个断点。在你打破顶部之后,点击播放。如果你没有触及底部,你知道问题出在该区域的某个地方。
Or, do some sort of logging like putting Console.WriteLn("Entering MyFunction()") at various places in the code.
或者,执行某种日志记录,例如将Console.WriteLn(“Entering MyFunction()”)放在代码中的不同位置。
Once you know where the problem is at, you can fix it.
一旦你知道问题出在哪里,你就可以解决它。