CCNet.Build.Common.Execute.Run C# (CSharp) Method

Run() public static method

Runs custom tool and redirects its output to the main process.
public static Run ( string fileName, string arguments ) : void
fileName string
arguments string
return void
		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);
			}
		}