4

I use Jenkins version 1.500. I simply want to build my asp.net project, but I get this message:

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

Do you know why it is failure? Maybe the old version od Jenkins? Please, help.

user3146344
  • 207
  • 1
  • 3
  • 16

1 Answers1

4

It seems that because your %WORKSPACE% value has space in it (C:\Program Files (x86)\Jenkins\jobs\GoldFingers-Build\workspace) it breaks it into 2 arguments.

You need to move your Job's workspace to a location that won't have spaces in it. You can do either of the following:

  • Relocate your whole Jenkins' installation out of "Program Files"
  • Or, Use custom workspace (click on the Advanced... button on project configuration page, under Advanced Project Options

Or, update your MSBuild Plugin
According to the plugin wiki page, Release 1.19 fixes:

passing of release configurations with spaces in them

Slav
  • 27,057
  • 11
  • 80
  • 104
  • 1
    Better is to wrap the path in double quotations. (But note to exclude the trailing backslash: https://stackoverflow.com/a/13873241/908336) – Masood Khaari Aug 14 '15 at 10:39
  • It's equally important that the name of the job does not have spaces, because it's the same name used to create the "job" folder. If the job name is "Test Jenkinks 1.0", jenkins will create a folder called "Test Jenkinks 1.0" with espaces. – Carlos Dec 14 '16 at 21:26