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

MSBuild is unable to build projects in a different directory

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • msbuild-plugin
    • MS Windows Server 2008

      I use SVN to checkout a project to .\proj and a dependency to .\dep. The .sln file is at .\proj\proj.sln. I us the MsBuild plugin with the setting "MsBuild Build File" = "proj\proj.sln" (or a number of variants such as .\proj\proj.sln). Msbuild fails with MSB1009: Project file does not exist. However, running a similar command manually succeeds.

        1. badbuild.txt
          2 kB
        2. badconfig.PNG
          badconfig.PNG
          12 kB
        3. betterbuild.txt
          12 kB
        4. goodbuild.txt
          13 kB
        5. goodconfig.PNG
          goodconfig.PNG
          47 kB

          [JENKINS-13863] MSBuild is unable to build projects in a different directory

          Do you know a command line argument for msbuild to specify another path?

          Gregory Boissinot added a comment - Do you know a command line argument for msbuild to specify another path?

          Aaron Laws added a comment - - edited

          I should have attached this earlier. There's no command line argument, just specify the path to the project as the project file argument. Please see "betterbuild.txt" which I just ran by hand from the command line.

          Aaron Laws added a comment - - edited I should have attached this earlier. There's no command line argument, just specify the path to the project as the project file argument. Please see " betterbuild.txt " which I just ran by hand from the command line.

          Josselin Vallet added a comment - - edited

          I had the same issue,

          I solved this by using the environment variable WORKSPACE and setting the solution path to "%WORKSPACE%\proj\proj.sln".

          Josselin Vallet added a comment - - edited I had the same issue, I solved this by using the environment variable WORKSPACE and setting the solution path to "%WORKSPACE%\proj\proj.sln".

          Aaron Laws added a comment -

          Josselin Vallet , that workaround works, although I wouldn't call it a solution. Thanks for the advice!

          Aaron Laws added a comment - Josselin Vallet , that workaround works, although I wouldn't call it a solution. Thanks for the advice!

          Code changed in jenkins
          User: Gregory Boissinot
          Path:
          src/main/webapp/help-BuildFile.html
          http://jenkins-ci.org/commit/msbuild-plugin/b92b4c477a75a5e2f3bdb3193928596273ccc537
          Log:
          Add comment to fix JENKINS-13863

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Gregory Boissinot Path: src/main/webapp/help-BuildFile.html http://jenkins-ci.org/commit/msbuild-plugin/b92b4c477a75a5e2f3bdb3193928596273ccc537 Log: Add comment to fix JENKINS-13863

          Aaron Laws added a comment -

          There we go! Just change the documentation to make the implementation correct! Although the documentation is still probably lacking a bit. Perhaps

          This is the absolute path to the project file MSBuild will use. Alternatively, if the project file is in the root directory of the project's workspace, simply the name of the project file will suffice.

          Can someone give me directions on compiling the MSBuild Plugin and testing it locally? I would be happy to give this a whack. It seems like it should be simple. Most frameworks can resolve relative paths.

          Aaron Laws added a comment - There we go! Just change the documentation to make the implementation correct! Although the documentation is still probably lacking a bit. Perhaps This is the absolute path to the project file MSBuild will use. Alternatively, if the project file is in the root directory of the project's workspace, simply the name of the project file will suffice. Can someone give me directions on compiling the MSBuild Plugin and testing it locally? I would be happy to give this a whack. It seems like it should be simple. Most frameworks can resolve relative paths.

          Gregory Boissinot added a comment - https://wiki.jenkins-ci.org/display/JENKINS/Plugin+tutorial

          Code changed in jenkins
          User: Gregory Boissinot
          Path:
          src/main/java/hudson/plugins/msbuild/MsBuildBuilder.java
          src/main/resources/hudson/plugins/msbuild/MsBuildBuilder/config.jelly
          src/main/webapp/help-ContinueOnBuilFailure.html
          src/main/webapp/help-ContinueOnBuildFailure.html
          http://jenkins-ci.org/commit/msbuild-plugin/8176a5743bb48f378ef2e4aee78f75fae16f7711
          Log:
          Fix typo and fix JENKINS-13863

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Gregory Boissinot Path: src/main/java/hudson/plugins/msbuild/MsBuildBuilder.java src/main/resources/hudson/plugins/msbuild/MsBuildBuilder/config.jelly src/main/webapp/help-ContinueOnBuilFailure.html src/main/webapp/help-ContinueOnBuildFailure.html http://jenkins-ci.org/commit/msbuild-plugin/8176a5743bb48f378ef2e4aee78f75fae16f7711 Log: Fix typo and fix JENKINS-13863

          Aaron Laws added a comment -

          That change doesn't look so great. Now, there is a (transient) boolean called continueOnBuilFailure and a final called continueOnBuildFailure. The former is never written to and only accessed on line 70. eek.

          Aaron Laws added a comment - That change doesn't look so great. Now, there is a (transient) boolean called continueOnBuilFailure and a final called continueOnBuildFailure. The former is never written to and only accessed on line 70. eek.

          Gregory Boissinot added a comment - - edited

          There was an issue on backward compatibility.
          Fixed in version 1.15

          Gregory Boissinot added a comment - - edited There was an issue on backward compatibility. Fixed in version 1.15

            kdsweeney kdsweeney
            limited_atonement Aaron Laws
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: