• Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Critical Critical
    • msbuild-plugin
    • None
    • Jenkins 2.46.2
      MSbuild Plugin 1.27
      MSBuild version 14.0

      I have a MSBuild project that batch processes a list of projects and I have the task set there to ContinueOnError as I need all the projects to be compiled.

      In Jenkins I DO NOT have the Plugin configured to Continue Job on build Failure.

      During build an error occurs but the failure is not Failing the build when MSBuild is done and returns to Jenkins the Plugin is not failing out.

      MSBuild is reporting 12 Errors on exit but the plugin just lets the job continue, job status at that time is also not Failure. 

      These particular errors are somewhat unusual as they are from Postsharp and have a line that beings like this:
      20>unknown : error : error: Unhandled exception
      Not sure if that is the issue or not. 

       

       

          [JENKINS-44457] Not failing on error

          Hello,

          I think that since your msbuild task is set to continue on error, msbuild return code is 0 (success) even when one of the build failed. The plugin checks this return code to determine if msbuild succeeded or failed so it thinks there were no error and let the build process continue.

          You could either alter your msbuild project so that it returns an error when one of the build has failed or maybe take a look at some other Jenkins plugins that would fail the build based on some regex when postsharp errors appear.

          Lionel Cabasson added a comment - Hello, I think that since your msbuild task is set to continue on error, msbuild return code is 0 (success) even when one of the build failed. The plugin checks this return code to determine if msbuild succeeded or failed so it thinks there were no error and let the build process continue. You could either alter your msbuild project so that it returns an error when one of the build has failed or maybe take a look at some other Jenkins plugins that would fail the build based on some regex when postsharp errors appear.

          Jon Starbird added a comment -

          This was me not using the MSBuild ContinueOnError correctly with newer MSBuild. I was not aware they had enhanced that feature.

          I changed it to ContinueOnErrror=ErrorAndContinue and this makes everything work as needed.

           

          Jon Starbird added a comment - This was me not using the MSBuild ContinueOnError correctly with newer MSBuild. I was not aware they had enhanced that feature. I changed it to ContinueOnErrror=ErrorAndContinue and this makes everything work as needed.  

          Glad you found a solution. Thanks for sharing it.

          Lionel Cabasson added a comment - Glad you found a solution. Thanks for sharing it.

            marshall777 Lionel Cabasson
            jstarbird Jon Starbird
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: