【问题标题】:MSBUILD : error MSB1008: Only one project can be specified in teamcityMSBUILD : 错误 MSB1008: teamcity 中只能指定一个项目
【发布时间】:2013-06-03 11:13:27
【问题描述】:

我正在尝试使用 TeamCity 运行 MSBuild。

我有一个批处理文件,我将参数传递给它并且构建工作。当我尝试通过 TeamCity 运行时,出现以下错误

[13:24:46][MSBuild output] Start MSBuild...

[13:24:46][MSBuild output] 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe' 
'"@C:\TeamCity\buildAgent\work\999585556854a516\Build\Default.msbuild.teamcity.msbuild.tcargs" C:\TeamCity\buildAgent\work\999585556854a516\Build\Default.msbuild.teamcity'

[13:24:46][MSBuild output] working dir = 'C:\TeamCity\buildAgent\work\999585556854a516'

[13:24:46][MSBuild output] Microsoft (R) Build Engine Version 4.0.30319.1

[13:24:46][MSBuild output] [Microsoft .NET Framework, Version 4.0.30319.296]

[13:24:46][MSBuild output] Copyright (C) Microsoft Corporation 2007. All rights reserved.

[13:24:46][MSBuild output]

[13:24:46][MSBuild output] MSBUILD : error MSB1008: Only one project can be specified.

[13:24:46][MSBuild output] Switch: C:\TeamCity\buildAgent\work\999585556854a516\Build\Default.msbuild.teamcity

[13:24:46][MSBuild output]

[13:24:46][MSBuild output] For switch syntax, type "MSBuild /help"

在 TeamCity 中,我的命令行参数字段看起来像 Configuration=Debug;DeployPath=E:\websites\umbraco\mysite;Environment=Dev;

我确实在 StackOverflow 上进行了搜索,遇到类似问题的人提到确保命令行参数中没有空格,我的 sln 和 proj 文件/页面也没有空格。

正如我所说,当我使用这些参数运行批处理文件时,一切正常,但是,TeamCity 失败了。

【问题讨论】:

  • 能否请您发布该批处理文件的内容。另外,您是否为您的帖子找到了解决方案

标签: msbuild teamcity msbuild-4.0 teamcity-7.1


【解决方案1】:

我设法在命令行中重现了错误:显然 Default.msbuild.teamcity.msbuild.tcargs 的文件内容需要是:

/p:Configuration=Debug;DeployPath=E:\websites\umbraco\mysite;Environment=Dev;

代替:

Configuration=Debug;DeployPath=E:\websites\umbraco\mysite;Environment=Dev;

【讨论】:

  • 佩德罗,非常感谢你的回复,我不得不采取最后一个分号。这几天我一直在苦苦挣扎。
  • 我还没有找到这个文件,但我只是在 MsBuild 构建步骤中更改了命令行参数,它工作了......
  • @Pedro Pombeiro:我试过MSBuild.exe C:\BuildAgent\work\4c7b8ac8bc7d723e\WebService.sln /p:Configuration=Release /p:OutputPath=bin /p:DeployOnBuild=True /p:DeployTarget=MSDeployPublish /p:MsDeployServiceUrl=https://204.158.674.5/msdeploy.axd /p:username=Admin /p:password=Password#321 /p:AllowUntrustedCertificate=True /p:DeployIisAppPath=Default WebSite/New /p:MSDeployPublishMethod=WMSVC。它给了我一个错误MSBUILD : error MSB1008: Only one project can be specified. Switch: WebSite/New。可能是什么问题?
  • @NevinRaj:您可以尝试在参数值周围添加逗号吗? (即/p:DeployIisAppPath="Default WebSite/New"
猜你喜欢
  • 2011-04-16
  • 2018-05-28
  • 2020-12-11
  • 2018-02-01
  • 2014-08-07
  • 1970-01-01
  • 2017-10-25
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多