private void btnBuild_Click(object sender, EventArgs e)
{
richTextBox1.Text = "";
string[] solutions = GetSolutions();
foreach (string solution in solutions)
{
var startinfo = new ProcessStartInfo();
startinfo.FileName = @"C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe";
startinfo.Arguments = "/t:rebuild /p:Configuration=Debug " + solution;
startinfo.RedirectStandardError = true;
startinfo.RedirectStandardOutput = true;
startinfo.UseShellExecute = false;
Process build = Process.Start(startinfo);
//string error = build.StandardError.ReadToEnd();
string output = build.StandardOutput.ReadToEnd();
build.WaitForExit();
richTextBox1.Text = output;
}
}
private string[] GetSolutions()
{
string[] filePaths = Directory.GetFiles(txtLoc.Text);
return filePaths;
}
{
richTextBox1.Text = "";
string[] solutions = GetSolutions();
foreach (string solution in solutions)
{
var startinfo = new ProcessStartInfo();
startinfo.FileName = @"C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe";
startinfo.Arguments = "/t:rebuild /p:Configuration=Debug " + solution;
startinfo.RedirectStandardError = true;
startinfo.RedirectStandardOutput = true;
startinfo.UseShellExecute = false;
Process build = Process.Start(startinfo);
//string error = build.StandardError.ReadToEnd();
string output = build.StandardOutput.ReadToEnd();
build.WaitForExit();
richTextBox1.Text = output;
}
}
private string[] GetSolutions()
{
string[] filePaths = Directory.GetFiles(txtLoc.Text);
return filePaths;
}
No comments:
Post a Comment