2009-01-15 54 views
3

我需要從一個bat文件中執行aspnet_compiler,以維護CruiseControl.NET中自動發佈ASP.NET應用程序。如何從bat文件使用aspnet_compiler?

aspnet_compiler運行良好,如果我手動打開Visual Studio命令提示符,但不運行,如果我打開一個正常的cmd.exe。

我應該採取哪些步驟使aspnet_compiler可以通過正常的cmd.exe訪問?

回答

4

對於Visual Studio 2008:

call "%VS90COMNTOOLS%\vsvars32.bat" 
1

近批處理文件的頂部:

CALL "C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat" 

這將正確設置你的路徑。

在您的計算機上安裝VS.NET的位置可能會有所不同。要找到正確的路徑,請爲「Visual Studio nnn命令提示符」快捷方式選擇「屬性」。

或者您可以在批處理文件中包含aspnet_compiler的完整路徑。

+0

謝謝。儘管我使用了Roger的解決方案,因爲我不喜歡嵌入整個路徑。 – Petros 2009-01-15 10:19:57