我需要从一个bat文件中执行aspnet_compiler,以维护CruiseControl.NET中自动发布ASP.NET应用程序。如何从bat文件使用aspnet_compiler?
aspnet_compiler运行良好,如果我手动打开Visual Studio命令提示符,但不运行,如果我打开一个正常的cmd.exe。
我应该采取哪些步骤使aspnet_compiler可以通过正常的cmd.exe访问?
我需要从一个bat文件中执行aspnet_compiler,以维护CruiseControl.NET中自动发布ASP.NET应用程序。如何从bat文件使用aspnet_compiler?
aspnet_compiler运行良好,如果我手动打开Visual Studio命令提示符,但不运行,如果我打开一个正常的cmd.exe。
我应该采取哪些步骤使aspnet_compiler可以通过正常的cmd.exe访问?
对于Visual Studio 2008:
call "%VS90COMNTOOLS%\vsvars32.bat"
近批处理文件的顶部:
CALL "C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat"
这将正确设置你的路径。
在您的计算机上安装VS.NET的位置可能会有所不同。要找到正确的路径,请为“Visual Studio nnn命令提示符”快捷方式选择“属性”。
或者您可以在批处理文件中包含aspnet_compiler的完整路径。
谢谢。尽管我使用了Roger的解决方案,因为我不喜欢嵌入整个路径。 – Petros 2009-01-15 10:19:57