简体   繁体   中英

How do you run a console application in the Visual Studio output window, instead of opening a new command prompt?

I'm developing a simple console application in Visual Studio 2008 and want to run it in the output window inside Visual Studio 2008, instead of having a separate command prompt window come up. Is there a way to do this?

If you run the console app in the post build step it's output will go to the output window. The inability to do this easily has been on of my biggest peeves with VS (any version)

ctrl + F5似乎在调试菜单中“无需调试启动”。

Does it actually have to be a console application? If you make it a WinForms app (even though it doesn't create any GUI elements) you'll get the console output in the Output window. However, you then can't read from console input, and obviously you won't get any output at all if you run from a real command line or in explorer. For simple test applications this may be fine, of course!

我知道的唯一方法是将其添加为外部工具,并在定义工具时勾选“ 使用输出窗口”复选框。

这是一个相当古老的问题,但由于尚未将答案标记为解决方案,请尝试在此处给出的答案: 在Visual Studio中输出控制台应用程序而不是控制台

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM