Is there a way that I can capture build output, i.e. the text that is output to the Output Window? Right now my only alternative to copy and pasting the text from the Output Window, is to build from a command line and redirect the output to a file.
A quick look at the C# compiler command line options does not reveal any option for specifying an output file for messages like warnings and errors, so I’m guessing VS hooks into the csc.exe process’s output stream, to capture its text and write it to the Output Window. Maybe there is a gap where a custom application can also hook in.
Add the following macro to VS
EnvironmentEventModule (Tools->Macros->Macros IDE…) or ALT+F11. The macro runs after a build completes whether successfully or not.This will pipe the text output from the output window, more specifically the
Buildview of the output window tobuild_output.log. Other IDE Guids can be found on MSDN.As a reference, the solution was based on HOWTO: Get an OutputWindowPane to output some string from a Visual Studio add-in or macro
The above can be tweaked to probably output build info on a per project basis as well. File names for build logs etc can probably be configured based on the current project being built (not too sure about this) and above all you can probably keep the build history.
There a whole of VS events that one can hook into, so the type of things one can do are endless
This was tested on VS2010 Ultimate…