在Visual Studio 2008中进行调试时,如何通过管道传输输出? [英] How do I pipe output when debugging in Visual Studio 2008?

查看:119
本文介绍了在Visual Studio 2008中进行调试时,如何通过管道传输输出?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试去项目属性,在配置属性下选择调试,并将命令参数设置为> out.txt"(当然不带引号).但是,当我运行程序(使用F5)时,仍然在控制台上看到输出,并且没有创建out.txt文件.这只是一个简单的C ++ Hello World程序.这些步骤对我的朋友有效,但对我不起作用(他也在使用VS2008).我听说过禁用托管过程,但这似乎仅适用于Visual Studio 2005.

I tried going to project properties, selected debugging under configuration properties, and set command arguments to "> out.txt" (without quotation marks of course). However, when I run the program (with F5) I still see output on the console, and no out.txt file is created. This is just a simple C++ Hello World program. These steps worked for my friend but not for me (he's using VS2008 also). I've heard of disabling the hosting process but it seems that's just for Visual Studio 2005.

似乎将> out.txt"作为参数传递进来. argc为3,argv [1]为>",而argv [2]为"out.txt".这不应该发生吗?我该怎么解决?

It appears that "> out.txt" is being passed in as an argument. argc is 3, argv[1] is ">", and argv[2] is "out.txt". Is this not supposed to happen? What can I do to fix it?

推荐答案

根据此处下载SP1.

According to this bug report on the Microsoft Connect website, this issue was fixed in Visual Studio 2008 Service Pack 1. I'm running VS2008 SP1 on my system, and output redirection works OK for me. You can download SP1 here.

这篇关于在Visual Studio 2008中进行调试时,如何通过管道传输输出?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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