Improving the VS.NET Build Output Pane

One annoyance with the VS.NET IDE is the less than helpful build output pane displayed on completion of a build.  As shown below it's not particularly descriptive.

However, the following (slightly abridged) macro created by Vitaly Belman at CodeProject can change that:-

Public Sub BuildEvents_OnBuildDone(ByVal Scope As EnvDTE.vsBuildScope, ByVal Action As EnvDTE.vsBuildAction) Handles BuildEvents.OnBuildDone

    ' Create a tool window handle for the Output window.
    '
http://www.codeproject.com/useritems/Filter_build_output.asp
   
    Dim win As Window = DTE.Windows.Item(EnvDTE.Constants.vsWindowKindOutput)
    ' Create handles to the Output window and its panes.
    Dim OW As OutputWindow = win.Object
    Dim OWp As OutputWindowPane
    Dim Loc As Integer
   
    OWp = OW.OutputWindowPanes.Item(1)
    OWp.TextDocument.Selection.SelectAll()
    Dim Context As String = OWp.TextDocument.Selection.Text
    OWp.TextDocument.Selection.CharLeft()
   
    Loc = InStr(Context, "---------------------- Done ----------------------")
   
    OWp = OW.OutputWindowPanes.Item(2)
    OWp.Activate()
    OWp.Clear()
    OWp.OutputString(Mid(Context, 1, Loc - 7))
    OWp.TextDocument.Selection.GotoLine(OWp.TextDocument.EndPoint().Line())
End Sub

This macro which handles the OnBuildDone event, results in a much more helpful display as shown below.

Additionally, I disable the "Show Task List window if build finishes with errors" option (Options>Environment>Projects and Solutions) to make this the default display on completion of a build.

2 Comments

  • What's the difference with what is displayed on the task list?

  • The task list is considered by many to be unsuitable when a large number of errors are generated. This is particularly the case when using C++/Managed C++. Many coming from a VC++/MFC background are used to such output, rather than a VB6 type task list.

Comments have been disabled for this content.