Jenkins 错误 : MSB1008: Only one project can be specified

标签 jenkins msbuild

我使用 Jenkins 版本 1.500。我只是想构建我的 asp.net 项目,但我收到以下消息:

Path To MSBuild.exe: C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSbuild.exe
Executing the command cmd.exe /C C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSbuild.exe %WORKSPACE%\trunk\src\GoldFingers.Uk.sln && exit %%ERRORLEVEL%% from C:\Program Files (x86)\Jenkins\jobs\GoldFingers-Build\workspace
[workspace] $ cmd.exe /C C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSbuild.exe %WORKSPACE%\trunk\src\GoldFingers.Uk.sln && exit %%ERRORLEVEL%%
Microsoft (R) Build Engine Version 4.0.30319.1
[Microsoft .NET Framework, Version 4.0.30319.1]
Copyright (C) Microsoft Corporation 2007. All rights reserved.

MSBUILD : error MSB1008: Only one project can be specified.
Switch: Files

For switch syntax, type "MSBuild /help"
Build step 'Build a Visual Studio project or solution using MSBuild' marked build as failure
Finished: FAILURE

你知道为什么会失败吗?也许旧版本 od Jenkins ? 请帮忙。

最佳答案

似乎是因为您的 %WORKSPACE% 值中有空格 (C:\Program Files (x86)\Jenkins\jobs\GoldFingers-Build\workspace)它将它分成 2 个参数。

您需要将作业的工作区移动到一个没有空格的位置。您可以执行以下任一操作:

  • 将整个 Jenkins 安装从“程序文件”中移出
  • 或者,使用自定义工作区(单击项目配置页面上的高级... 按钮,位于高级项目选项下

或者,更新您的 MSBuild Plugin
根据插件维基页面,Release 1.19 修复:

passing of release configurations with spaces in them

关于 Jenkins 错误 : MSB1008: Only one project can be specified,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24271528/

相关文章:

git - 当特定文件夹更改时在 Jenkins 中构建触发器

deployment - 是否可以使用 Condition 来验证 UsingTask 的 AssemblyFile 属性是否存在?

.net - 引用 COM 对象 ActiveD 或 MSXML2 时出现大量构建警告

visual-studio-2010 - VS2010 - 相同的解决方案(是 SVN 结帐),不同的位置,一个构建,一个失败任何想法?

jenkins - Chef 卡在 "Recipe: java::openjdk"

Jenkins:关于build.xml的路径

java - 为什么 stash/unstash 在此 Jenkinsfile 中不起作用?

c# - 根据编译器标志/目标框架安装 nuget 包

visual-studio - 如何让 MSBuild 了解我的 tlog 文件中的读取依赖项?

java - 我无法在 Jenkins 中构建工作,,,即使我已经给出了 github 的路径