【问题标题】:Not able to build .net solution in Team city by using Nant.exe无法使用 Nant.exe 在 Team city 中构建 .net 解决方案
【发布时间】:2012-01-31 04:15:52
【问题描述】:

我通过使用 Nant 作为构建来使用团队城市来构建我的项目。所以我创建了一个批处理文件来构建我的项目,我使用 Nant.exe 负责构建我的解决方案。

当我从命令提示符运行此批处理文件时,我能够成功构建我的解决方案。但是当我从 TeamCity 运行相同的文件时,它给了我构建失败错误。

所以我已经验证了路径并且这也是正确的。下面是我在队城里保存的路径。

  1. 构建文件的路径:Build.bat(用于构建的 bat 文件)
  2. 直接工作:D:\CMS(我的 bat 文件所在的路径。
  3. NAnt home:路径是 Nant exe 所在的位置。
  4. 目标框架:Net 4.0

当我每次构建失败并生成以下日志时,我都会按团队城市破坏此构建。

[21:27:54]: Checking for changes
[21:27:55]: Clearing temporary directory: C:\TeamCity\buildAgent\temp\buildTmp
[21:27:55]: Checkout directory: D:\Projects\JoyaCMS\src
[21:27:56]: Repository sources transferred
[21:27:55]: Updating sources: server side checkout... (1s)
[21:27:57]: Publishing internal artifacts (2s)
[21:27:57]: Starting: D:\Projects\JoyaCMS\src\UppercuT\lib\NAnt\NAnt.exe -      buildfile:D:\Projects\JoyaCMS\src\build.bat -targetframework:net-4.0 -  extension:C:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NAntLoggers   .dll -listener:JetBrains.BuildServer.NAntLoggers.NAntListener
[21:27:57]: in directory: D:\Projects\JoyaCMS\src
[21:27:57]: Process exited with code 1
[21:27:57]: NAnt output:
[21:27:57]: NAnt 0.91 (Build 0.91.3881.0; alpha2; 8/17/2010)
[21:27:57]: Copyright (C) 2001-2010 Gerry Shaw
[21:27:57]: http://nant.sourceforge.net
[21:27:57]: BUILD FAILED
[21:27:57]: For more information regarding the cause of the build failure, run the   build again in debug mode.
[21:27:57]: Try 'nant -help' for more information
[21:27:57]: D:\Projects\JoyaCMS\src\build.bat(1,1):
[21:27:57]: Error loading buildfile.
[21:27:57]: Data at the root level is invalid. Line 1, position 1.
[21:28:02]: Publishing internal artifacts (1s)
[21:28:05]: Build finished

所以让我知道如何在团队城市中解决这个问题。以及我需要执行哪些设置才能解决此问题。

谢谢, 阿米特

【问题讨论】:

    标签: build teamcity nant


    【解决方案1】:

    首先,我注意到在您的 NAnt 调用中出现了一些额外的空白字符,例如- extension:C:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NAntLoggers .dll。可能是 SO 格式问题,但如果它们属于您的批次,请先将其删除。

    如果这没有帮助,请通过 NAnt 开关 -v+ 激活详细构建输出。这应该会提供更多信息。

    【讨论】:

    • 感谢您的回复。如果我想通过 NAnt 激活 Verbose 构建输出,那么我该如何实现呢?因为我是 Teamcity 和 NAnt 的新手,所以如果你能提供我的步骤,那对我真的很有帮助。
    • 添加 -v+ 作为调用 NAnt.exe 的参数
    猜你喜欢
    • 1970-01-01
    • 2023-03-31
    • 1970-01-01
    • 1970-01-01
    • 2016-10-24
    • 1970-01-01
    • 1970-01-01
    • 2018-08-22
    • 2013-11-27
    相关资源
    最近更新 更多