3

I'm making Visual Studio package where I start devenv.exe and try to build other solution. I need to get building output in realtime, so user can see building progress/output, but I don't know how to do it and if it's even possible.

I tried such way :

            string rebuildLog = string.Empty;
            string logFileName = System.IO.Path.GetTempFileName();

            System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo();
            psi.FileName = @"devenv.exe";
            psi.Arguments = "\"" + config.DmsPath + "\"" + @" /rebuild" + " Release|x64 " +" /out " + logFileName;

            System.Diagnostics.Process process = new System.Diagnostics.Process();
            process.StartInfo = psi;
            process.StartInfo.RedirectStandardOutput = true;
            process.StartInfo.UseShellExecute = false;

            process.Start();

            while (!process.StandardOutput.EndOfStream)
            {
                string line = process.StandardOutput.ReadLine();
                MessageBox.Show(line); // just to see if it works. It should go to log form
            }

            
            rebuildLog = GetRebuildLog(logFileName);

And rebuildLog has output.

What can I try next?

1
  • I am not sure but may be you need - ant.apache.org/antlibs/dotnet which is automated build system and do what you are expecting Commented Oct 26, 2012 at 13:10

1 Answer 1

10

I found answer. devenv.exe doesn't write simple console output, so i had to change

psi.FileName = @"devenv.exe"; to psi.FileName = @"devenv.com"; and it worked.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.