0
我想通過Process.Start執行TFS,但我有一些困難,我不明白爲什麼。這裏是我的代碼片段:Process.Start - 與參數TFS命令行掙扎
/// <summary>
/// Get the entire history for a project
/// </summary>
public void GetHistory(String project)
{
ProcessStartInfo info = new ProcessStartInfo();
String fileName = Path.GetTempFileName();
info.Arguments = String.Format("history \"{0}\" /recursive /format:Detailed /noprompt > {1}", "c:\\source\\ " + project, fileName);
info.FileName = "\"C:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\Common7\\IDE\\tf.exe\"";
info.RedirectStandardError = true;
info.UseShellExecute = false;
Process process = new Process();
process.StartInfo = info;
process.Start();
process.WaitForExit();
Console.WriteLine(process.StandardError.ReadToEnd());
Console.WriteLine("History written to " + fileName);
Console.ReadKey();
}
這導致了一組像這樣的論點(我只是刪除了完整的項目名稱):
然後我得到以下錯誤:
The history command takes exactly one item.
如果我拼湊的字符串,並以正常的命令行執行然而然後它工作:
誰能告訴我我失蹤了什麼?