.NET Framework Bookmark and Share   
 index > MSBuild > Capturing Text Output from Exec Task
 

Capturing Text Output from Exec Task

Is there any way I can capture the text that is output to the console while executing the <Exec> task to a property? I'm porting my NAnt Scripts to MSBuild and we Create SCM ChangeLists from the exec task. I'd just like to extract the ChangeList ID.

Chike

Chike

I checked the msdn2 page for the Exec task (http://msdn2.microsoft.com/en-us/x8zx72cd.aspx) and it says:

One disadvantage of using the Exec task rather than a more specific task is that it cannot gather output from the tool or command that it runs.

At the risk of sounding silly, maybe you could pipe the output of the command to a file ( with | or > in your Exec command) and read from the file with the ReadLinesFromFile task?

Stephane

Stephane Tombeur

I checked the msdn2 page for the Exec task (http://msdn2.microsoft.com/en-us/x8zx72cd.aspx) and it says:

One disadvantage of using the Exec task rather than a more specific task is that it cannot gather output from the tool or command that it runs.

At the risk of sounding silly, maybe you could pipe the output of the command to a file ( with | or > in your Exec command) and read from the file with the ReadLinesFromFile task?

Stephane

Stephane Tombeur

You can use google to search for other answers

Custom Search

More Threads

• Where can I get a complete list of MSBuild tasks?
• Batching and exit code
• pass a local property into another target
• Copy Recursively but exclude top directory
• Replacing a Target conditionally?
• how to call a Target with parameters in a loop
• Creating custom functions in MSBuild, like Exists() ?
• Need help with building multiple configurations with devenv...
• New Microsoft SDC Tasks Release
• .NET 3.5 MSBuild to Build .NET 2.0 Projects