2010-05-28 131 views
0

我有一個生成文件與nant現在我需要做的是執行它與命令提示符使用c# 我試過下面,但我不能夠建立它.. pls幫我急了.. thnaks提前使用c#在命令提示符運行nant生成文件

System.Diagnostics.Process.Start("exe -buildfile:d:\buildfile.build); 

,當我通過乳寧CMD直接促使它正在

回答

1

你有沒有安裝楠作爲環境變量?

System.Diagnostics.Process.Start("nant.exe -buildfile:d:\buildfile.build); 
+0

沒有u能告訴我如何設置環境我只是specifing如「d的惡性路徑:\\ \\楠斌\\ Nant.exe /編譯d:\\\ buildfile.build – happy 2010-05-28 11:02:51

+1

其?如果您指定的完整路徑應該工作 - 什麼你得到 更新PATH環境變量中的錯誤信息,包括 \ BIN(我的設置,這是C:\楠-0.86 \ BIN) 看到。這篇文章爲管理環境變量 - http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/environment_variables.mspx?mfr=true – 2010-05-28 12:42:35

+0

你也可以重命名你buildfile.build默認構建 - 那麼你不必指定-bu ildfile:d:\ buildfile.build 只需在目錄中運行NANT – 2010-05-28 12:52:53

相關問題