-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
Windows, NET 4
I have a build step with the MSBuild File configured thus:
%WORKSPACE%\wbuilder_%NODE_NAME%_%JOB_NAME%\Alpha\AlphaBeta\AlphaSolution\AlphaSolution.sln
Note that %WORKSPACE% will expand to C:\Program Files\Jenkins\jobs\AlphaBeta\workspace
This produces:
----------
Executing command: cmd.exe /C C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe %WORKSPACE%\wbuilder_%NODE_NAME%_%JOB_NAME%\Alpha\AlphaBeta\AlphaSolution\AlphaSolution.sln && exit %%ERRORLEVEL%%
[wbuilder_master_AlphaBeta] $ cmd.exe /C C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe %WORKSPACE%\wbuilder_%NODE_NAME%_%JOB_NAME%\Alpha\AlphaBeta\AlphaSolution\AlphaSolution.sln && exit %%ERRORLEVEL%%
Microsoft (R) Build Engine Version 4.0.30319.1
[Microsoft .NET Framework, Version 4.0.30319.235]
Copyright (C) Microsoft Corporation 2007. All rights reserved.
MSBUILD : error MSB1008: Only one project can be specified.
Switch: Files\Jenkins\jobs\AlphaBeta\workspace\wbuilder_master_AlphaBeta\Alpha\AlphaBeta\AlphaSolution\AlphaSolution.sln
----------
MSBuild is not applying quotes to the expanded parameter, so it is executing:
cmd.exe /C C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe C:\Program Files\Jenkins\jobs\AlphaBeta\workspace\wbuilder_master_AlphaBeta\Alpha\AlphaBeta\AlphaSolution\AlphaSolution.sln && exit %%ERRORLEVEL%%
There is a workaround which is to apply quotes in the Project configuration UI but this is not an intuitive operation for a user.
I would suggest that MSBuild apply quotes if they don't already exist around the parameter.