I do not like the behaviors allowed in Visual Studio regarding showing the Errors List and Output window during a build. So, I finally created a macro to get the exact behavior I want.. And, I love it!
First off, you need to turn off two options in Visual Studio settings, under Projects and Solutions | General.
Un-check the following:
- Always show Error List if build finishes with errors
- Show Output window when build starts
The script does the following:
- When a build starts it (optionally) shows the Output window (line #9).
- When an individual project is finished compiling, notify the user (line #22) and (optionally) stop building any further projects (line #25).
- When the entire build has finished and one or more projects failed, display the Output window (line #35). If there were no failures, show and then hide the Output window (line #38) and notify the user.
Note: When the build finishes successfully, the reason I show and then hide the Output window, is because it may already be open and I want to be sure I close it. So far, I haven’t found an easy way to close the Output window, when it may or may not have focus in the Visual Studio IDE. As it is, I only rarely see it flicker open then closed. If you have any ideas, please let me know at email@example.com!
Read the comments in the code below for details on how its done!