如何关闭“孤儿"从 Visual Studio 中打开的控制台窗口? [英] How to close an "orphaned" console window that was opened from within visual studio?

查看:63
本文介绍了如何关闭“孤儿"从 Visual Studio 中打开的控制台窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Visual Studio 中处理控制台应用程序时,我将通过按 F5 将应用程序置于调试模式来运行该应用程序.有时(我不确定这是如何发生的),我会在 Visual Studio 中返回编辑模式",并且调试后的控制台窗口仍将打开.

When working on console applications in Visual Studio, I will run the application by pressing F5 to bring it into debug mode. Occasionally (and I'm not sure how this happens), I'll get back into "edit mode" in Visual Studio and the debugged console window will still be open.

它将保持打开状态,但完全没有响应.我无法通过右键单击窗口并单击关闭"来关闭窗口;我无法通过任务管理器关闭它,也无法通过结束特定进程(据我所知)来关闭它.事实上,如果不按电源按钮重新启动计算机,我什至无法在发生这种情况时退出 Windows.

It will remain open but entirely unresponsive. I can't close the window by right-clicking the window and clicking "close"; I can't close it via the Task Manager, and I can't close it by ending a particular process (to my knowledge). In fact, I can't even exit Windows when this happens without physically pressing the power button to reboot my computer.

如何在不重新启动计算机的情况下关闭窗口?

How can I get the window to close without having to reboot my computer?

系统信息:Windows XP SP3、Visual Studio 2010

它通常在我进入调试模式后发生.所有异常都会冒泡并打印到控制台,所以这不是因为异常导致应用程序中断,但有时我会逐步遍历应用程序,直到到达应用程序的捕获到异常部分em>,但在它真正返回到 UI 之前.

It usually happens after I break into debug mode. All exceptions are bubbled up and printed to the console, so it's not because the exception causes the application to break, but sometimes I do step through the application until I get to the part of the application that the exception is caught, but before it actually gets thrown back to the UI.

推荐答案

我遇到了几乎相同的问题,并找到了不同的解决方案,因此在此处发布以帮助其他人...

I've been having ALMOST the same problem, and found a different solution, so posting here in case it helps someone else...

就我而言,我运行的是 XP SP3 和 VS 2005.如果我停止调试控制台应用程序(有时),命令窗口将不会关闭.

In my case I'm running XP SP3 and VS 2005. If I stop debugging the console app (sometimes) the command window won't close.

问题是进程实际上已经退出了,它根本没有出现在任务管理器中,所以没有办法对窗口或关闭做任何事情.该窗口仍然对标记/复制/粘贴/滚动等做出响应,仅此而已.

The problem is the process has actually exited, it simply doesn't appear in task manager, so there's no way to do anything with the window or shutdown. The window remains responsive to mark/copy/paste/scroll etc, but that's it.

在此处找到了有关 MS 支持的热修复程序:http://support.microsoft.com/kb/982551

Found a hot fix here on MS support: http://support.microsoft.com/kb/982551

这篇关于如何关闭“孤儿"从 Visual Studio 中打开的控制台窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆