If I execute an <exec> task from my NAnt script, with
the program set to “devenv.exe” (VS.NET) and the command line
argument set to “/build Debug” (causing it to perform a
command-line build instead of launch the IDE GUI), I cannot capture the
output. Attempts to read the process’s output in NAnt fail. I
stepped through with the debugger, and the line in StreamReaderThread_Output(): String
logContents = reader.ReadLine(); Always returns null. I’m not sure the problem is
NAnt-specific, because I’ve tried doing the same thing from a separate
program, and still was not able to capture devenv output via this
mechanism. This is the first external program I’ve run into where I
could not capture its output. Maybe devenv isn’t writing to stdout,
but when I run “devenv MySolution.sln /build Debug >Debug.txt”
from the command prompt, it redirects everything into Debug.txt, leading one to
believe it is writing to stdout. Does anyone understand what is going on here? Thanks. BTW, I resorted to simply exec’ing devenv instead of
using the <solution> task because I had a custom tool installed with
VS.NET, and the solution task wouldn’t accept it. - Kevin |
- [nant-dev] Capturing devenv.exe output Kevin