【问题标题】:How can I use aspnet_compiler from a bat file?如何从 bat 文件中使用 aspnet_compiler?
【发布时间】:2009-01-15 08:28:40
【问题描述】:

我需要从我维护的一个 bat 文件中执行 aspnet_compiler,以便从 CruiseControl.NET 中自动发布 ASP.NET 应用程序。

如果我手动打开 Visual Studio 命令提示符,aspnet_compiler 运行良好,但如果我打开普通 cmd.exe,则不会运行。

我应该采取哪些步骤才能通过普通的 cmd.exe 访问 aspnet_compiler?

【问题讨论】:

    标签: asp.net visual-studio


    【解决方案1】:

    对于 Visual Studio 2008:

    call "%VS90COMNTOOLS%\vsvars32.bat"
    

    【讨论】:

      【解决方案2】:

      靠近批处理文件的顶部:

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

      这将正确设置您的路径。

      您计算机上 VS.NET 的安装位置可能不同。要找到正确的路径,请为“Visual Studio nnn 命令提示符”快捷方式选择“属性”。

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

      【讨论】:

      • 谢谢。不过我使用了 Roger 的解决方案,因为我不喜欢嵌入整个路径。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-03-09
      • 1970-01-01
      • 2010-10-13
      • 1970-01-01
      • 2010-10-24
      相关资源
      最近更新 更多