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

MSBuild fails in Declarative Pipeline

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      MSbuild Setup:

      Jenkinsfile snippet:

              stage('Build') {
                  steps {
                      echo 'Building..'
                      bat "\"${tool 'MSBuild'}\" ${SQLPROJ} /p:Configuration=Release /p:Platform=\"Any CPU\" /p:ProductVersion=1.0.0.${env.BUILD_NUMBER}"
                  }
              }
      

      Console output:

      {{D:\var\lib\jenkins\workspace\VisionPipeline>"c:\program files (x86)\msbuild\14.0\bin\" TBSM.Vision.Database\TBSM.Vision.Database\Vision.sqlproj /p:Configuration=Release /p:Platform="Any CPU" /p:ProductVersion=1.0.0.11
      '"c:\program files (x86)\msbuild\14.0\bin\"' is not recognized as an internal or external command,
      operable program or batch file.
      ??}}

      Do I have to specify msbuild.exe in the tool specification, above (that works, btw)? Or, is there a better way?

      Also, when will MSBuild be a first-class citizen in Pipeline (so we don't have to use bat to call it)

        Attachments

          Activity

          Hide
          bakarthi karthik Kumar BA added a comment -

          same error I am also facing anyone can help me regarding msbuild

          Show
          bakarthi karthik Kumar BA added a comment - same error I am also facing anyone can help me regarding msbuild
          Hide
          bakarthi karthik Kumar BA added a comment -

          the same error I got unable to fix please can you help me on msbuild with declarative pipeline

          Show
          bakarthi karthik Kumar BA added a comment - the same error I got unable to fix please can you help me on msbuild with declarative pipeline
          Hide
          marshall777 Lionel Cabasson added a comment -

          Hello,

          You do have to add msbuild.exe manually. The tool path indicates the directory where msbuild can be found, not the path msbuild.exe itself.

          Show
          marshall777 Lionel Cabasson added a comment - Hello, You do have to add msbuild.exe manually. The tool path indicates the directory where msbuild can be found, not the path msbuild.exe itself.

            People

            Assignee:
            marshall777 Lionel Cabasson
            Reporter:
            gbritton Gerald Britton
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: