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

  • SEARCH
  • Home
  • 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 6565225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:04:02+00:00 2026-05-25T14:04:02+00:00

I am running a build, and I would like to be able to view

  • 0

I am running a build, and I would like to be able to view the progress as it happens. But I would also like to save the output if the build has an error.

I know I can use Process.UseShellExecute = false, and RedirectStandardOutput, but that’s only part of the story.

How can I do this?

  • 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-25T14:04:03+00:00Added an answer on May 25, 2026 at 2:04 pm

    Update

    As Greg mentions in the comments below, MSBuild can write out to a log file while also outputting to console out of the box.

    MSBuild [options] /filelogger /fileloggerparameters:LogFile=MSBuildLog.txt
    

    Try the following simple C# program. It will take the redirected STDIN (Console.In) and write it to one or more files and STDOUT (Console.Out).

    using System;
    using System.Collections.Generic;
    using System.IO;
    
    namespace RedirectToFile
    {
        class Program
        {
            static void Main(string[] args)
            {
                var buffer = new char[100];
                var outputs = new List<TextWriter>();
    
                foreach (var file in args)
                    outputs.Add(new StreamWriter(file));
    
                outputs.Add(Console.Out);
    
                int bytesRead;
                do
                {
                    bytesRead = Console.In.ReadBlock(buffer, 0, buffer.Length);
                    outputs.ForEach(o => o.Write(buffer, 0, bytesRead));
                } while (bytesRead == buffer.Length);
    
                outputs.ForEach(o => o.Close());
            }
        }
    }
    

    I use it to redirect the output from an MSBuild batch file to disk whilst still outputting to the console window.

    Usage: MSBuild [options] | RedirectToFile.exe MSBuildLog.txt
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know this sounds backwards but I would like to be able to determine
I would like my MSbuild build script to be able to detect which server
I'm running ant and added the below to build.xml but I'm getting:\ build.xml:51: Element
I would like to be able to click a button on a flash menu,
I would like to build a program which takes a username as parameter and
I would like to be able to run a batch file on a remote
I would like to contribute to an open-source Windows Mobile project, but it's being
Is it possible to cancel/abort a running build process in Visual Studio 2008? How?
I have a cruise control server running a build on a VM. All I
I have a CruiseControl build server running a large number of projects. On one

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.