none
Pre-build step with batch file echoing messages to "Output" window in real time

    Question

  • I am working on a Visual Studio 2015 build, with a pre-build step that calls a long-running batch file to copy dependencies around. When I run the build from VS2015 itself, the "Output" window waits until the batch file has finished executing to display any of the output messages. Is there any way of capturing Visual Studio's "Output" window as my standard output so that I can echo messages to it in real time from my batch file?
    Monday, March 20, 2017 2:18 PM

All replies

  • Hi Philip,

    Welcome to MSDN forum.

    Please go into the Tools->Options menu, and go to Projects and Solutions->Build and Run and change the value of the MSBuild project build output verbosity.

    When it set to Diagnostic, the output will contain all the information that a MSBuild need and produce, it's switches, parameteres, prerequisites and etc. The input parameter of the target and task, and also contains the value of the input and output parameter, the detail steps of the task execution. The time execution for each task. Besides, it will echo messages to "Output" window in real time.

    Best regards,

    Joyce


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, March 21, 2017 3:05 AM
  • Nope. I have tried building with the "MSBuild project build output verbosity" set to "Diagnostic" but the echo messages from the pre-build step's batch file were not shown until the batch file finished executing.
    Tuesday, March 21, 2017 11:53 AM
  • Hi Philip,

    Thank you for your update.

    Before the process of build finish, the output window shows detail steps of the task execution in real time, please check the screenshots. If I misunderstand you, please feel free to let me know.

    Best regards,

    Joyce


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, March 22, 2017 7:16 AM