Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-18560

Extra " when forming cmd line arguments for parameters containing a space

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Blocker Blocker
    • msbuild-plugin
    • None
    • Jenkins v1.520

      Hi there,

      I'm using version 1.18 of the MSBuild plugin and I've come across an issue with how it handles quotes for parameters.

      I have a matrix project setup where my build axes are specified like so:

      Name: VS
      Values: 10.0 11.0

      Name: Config:
      Values: Debug Release

      Name: TARGET
      Values: "Any CPU"

      MSBuild is invoked using the command line arguments:

      /p:Configuration="${CONFIG}";Platform="${TARGET}" /p:VisualStudioVersion=${VS}

      The resulting command line from the console output is this:

      cmd.exe /C C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe /nr:false /maxcpucount:8 /verbosity:normal "/p:Configuration="Debug";Platform="Any CPU"" /p:VisualStudioVersion=10.0 /p:CONFIG=Debug;VS=10.0;TARGET=Any+CPU;branch=Live Tools\Source\AssetAnalyzer\AssetAnalyzer.sln && exit %%ERRORLEVEL%% from C:\JCI\jobs\AssetAnalyzer-Live\workspace\CONFIG\Debug\TARGET\Any CPU\VS\10.0

      which reports:

      MSBUILD : error MSB1008: Only one project can be specified.
      Switch: Tools\Source\AssetAnalyzer\AssetAnalyzer.sln
      For switch syntax, type "MSBuild /help"

      I believe the command line should be:

      cmd.exe /C C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe /nr:false /maxcpucount:8 /verbosity:normal "/p:Configuration="Debug";Platform="Any CPU" /p:VisualStudioVersion=10.0 /p:CONFIG=Debug;VS=10.0;TARGET=Any+CPU;branch=Live Tools\Source\AssetAnalyzer\AssetAnalyzer.sln && exit %%ERRORLEVEL%% from C:\JCI\jobs\AssetAnalyzer-Live\workspace\CONFIG\Debug\TARGET\Any CPU\VS\10.0

      ie. Platform="Any CPU" instead of Platform="Any CPU""

      Can you fix this please?

      Regards,
      Tom

            kdsweeney kdsweeney
            tfields Thomas Fields
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: