In a VS C# 2008 project, I've found a problem with piping console output to a file.
For example, in the project settings, debug tab, start options, and command line arguments:
If I try to pipe to a file like this:
ExamineSTPErrorLogs > report.txt
which is something that worked in VS 2005, the "> report.txt" is showing as a parameter to the console application.
But the expected behavior is that this should be piped to a file.
If I would have used:
ExamineSTPErrorLogs ">" report.txt
I would expect ">" and "report" to be used as command line parameters.
Is there some kind of hack so this can be made to work correctly?
Otherwise I'll have to downgrade. Upmh!
-
-
Is there a good reason why you can't use the output window? If your program is writing to Console.Out rather than a parameterised stream you should consider some code changes to rectify it.
-
have you tried escaping the '>' (stream redirection) character ?
eg ^> or %> -
RichardRudek wrote:have you tried escaping the '>' (stream redirection) character ?
eg ^> or %>
Both escaping methods show up as args as:
"^>" "report.txt"
and
"%>" "report.txt"
I think there's a bug in VS 2008 that is treating arguments as parameters and not following the existing functionality of the previous version.
-
You might need to use a batch file then.
PS: I don't have VS2008, so I can't experiment... -
I should add I'm using VS 2008 Team Suite Edition.
Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.