Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4060054
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T15:17:21+00:00 2026-05-20T15:17:21+00:00

Is there a way that I can capture build output, i.e. the text that

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T15:17:22+00:00Added an answer on May 20, 2026 at 3:17 pm

    Add the following macro to VS EnvironmentEvent Module (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 Build view of the output window to build_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

    Visual Studio provides an Output
    window (“View”, “Other Windows”,
    “Output” menu) to show messages, debug
    information, etc. That window provides
    several panes that can be selected
    through a combobox, such as “Source
    Control”, “Build”, “Debug”, etc.

    The automation model (EnvDTE) provides
    the EnvDTE.OutputWindow,
    EnvDTE.OutputWindowPanes and
    EnvDTE.OutputWindowPane classes.

     Private Sub BuildEvents_OnBuildDone(ByVal Scope As EnvDTE.vsBuildScope, ByVal Action As EnvDTE.vsBuildAction) Handles BuildEvents.OnBuildDone
    
            Const BUILD_OUTPUT_PANE_GUID As String = "{1BD8A850-02D1-11D1-BEE7-00A0C913D1F8}"
    
            Dim t As OutputWindowPane
            Dim txtOutput As TextDocument
            Dim txtSelection As TextSelection
            Dim vsWindow As Window
    
            vsWindow = DTE.Windows.Item(EnvDTE.Constants.vsWindowKindOutput)
    
            Dim vsOutputWindow As OutputWindow
            Dim objOutputWindowPane As OutputWindowPane
            Dim objBuildOutputWindowPane As OutputWindowPane
            vsOutputWindow = DirectCast(vsWindow.Object, OutputWindow)
    
            For Each objOutputWindowPane In vsOutputWindow.OutputWindowPanes
                If objOutputWindowPane.Guid.ToUpper = BUILD_OUTPUT_PANE_GUID Then
                    objBuildOutputWindowPane = objOutputWindowPane
                    Exit For
                End If
            Next
    
    
            txtOutput = objBuildOutputWindowPane.TextDocument
            txtSelection = txtOutput.Selection
    
            txtSelection.StartOfDocument(False)
            txtSelection.EndOfDocument(True)
            objBuildOutputWindowPane.OutputString(Date.Now)
    
            txtSelection = txtOutput.Selection
            solutionDir = IO.Path.GetDirectoryName(DTE.Solution.FullName)
    
            My.Computer.FileSystem.WriteAllText(solutionDir & "\build_output.log", txtSelection.Text, False)
    
    
            MsgBox(txtSelection.Text)
    
        End Sub
    

    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…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.