public static void Run(string fileName, string arguments)
{
using (var process = CreateProcess(fileName, arguments))
{
process.Start();
var output = process.StandardOutput.ReadToEnd();
var error = process.StandardError.ReadToEnd();
process.WaitForExit();
Console.WriteLine(output);
if (!String.IsNullOrEmpty(error))
throw new ApplicationException(error);
}
}