简体   繁体   English

如何从bat文件中使用aspnet_compiler?

[英]How can I use aspnet_compiler from a bat file?

I need to execute aspnet_compiler from a bat file that I maintain to automate the publishing of a ASP.NET application from within CruiseControl.NET. 我需要从我维护的bat文件中执行aspnet_compiler,以自动从CruiseControl.NET中发布ASP.NET应用程序。

aspnet_compiler runs fine if I manually open the Visual Studio Command Prompt, but doesn't run if I open a normal cmd.exe. 如果我手动打开Visual Studio命令提示符,aspnet_compiler运行正常,但如果我打开正常的cmd.exe则不运行。

What steps should I take to make aspnet_compiler accessible through a normal cmd.exe? 我应该采取哪些步骤才能通过普通的cmd.exe访问aspnet_compiler?

对于Visual Studio 2008:

call "%VS90COMNTOOLS%\vsvars32.bat"

Near the top of your batch file: 靠近批处理文件的顶部:

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

This will set up your path correctly. 这将正确设置您的路径。

The installed location of VS.NET on your computer might be different. VS.NET在您的计算机上的安装位置可能不同。 To find the correct path, select 'Properties' for the "Visual Studio nnn Command Prompt" shortcut. 若要查找正确的路径,请为“Visual Studio nnn命令提示符”快捷方式选择“属性”。

Or you can just include the complete path to aspnet_compiler in your batch file. 或者您可以在批处理文件中包含aspnet_compiler的完整路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM