internal Process StartMsBuildProcess()
{
if (UseExistingBuild)
return null;
//invoke msbuild here!
string pathToMsBuild = Environment.ExpandEnvironmentVariables(Constants.MsBuildExe);
var info = new ProcessStartInfo(pathToMsBuild, "\"" + CcprojFile + "\" /target:publish")
{
UseShellExecute = false,
RedirectStandardOutput = true
};
var msbuildProcess = new Process
{
StartInfo = info
};
bool started = msbuildProcess.Start();
// TODO: Make a proper detail on the exception information by pulling back any FAILED messages or ERRORS from the output stream
string output = msbuildProcess.StandardOutput.ReadToEnd();
if (!started)
throw new ApplicationException("unable to start msbuild - do you have .NET framework v4 installed?");
msbuildProcess.WaitForExit();
return msbuildProcess;
}