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

Cannot use MSbuild in loop to build multiple projects in single action

    • Icon: New Feature New Feature
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • msbuild-plugin
    • None

      To build .NET projects, am using "Build a Visual Studio project or Solution using MSBuild" option under Build section in Jenkins job.

      By using this, i can run only one project file alone by specifying the below details.

      MSBuild Version: msbuild(set through environment variables)
      MSBuild Build File: ProjectA.sln
      Command Line Arguments: /p:Configuration=Release

      But my requirement is to build multiple projects using only one "Build a Visual Studio project or Solution using MSBuild" in my Jenkins job. Normally we can do this using iteration(getting all the solution files in a particular directory and build it)

      But in jenkins, is this possible by looping the "Build a Visual Studio project or Solution using MSBuild" or any other option available(plugin) to achieve this to pass multiple projects to MSBuild Build File: and build in single step?

          [JENKINS-36385] Cannot use MSbuild in loop to build multiple projects in single action

          Hello,

          For this purpose, I suggest you look at the pipeline-plugin as said in this topic. This could let you script a loop to run the build step multiple times.
          You can also consider creating a master solution file that will build the entire system. There is an article on MSDN about this stuff (see "The Partitioned Single Solution Model").
          If the solution files to build must be determined dynamicaly (because new solution are regularly created for example), you may also consider script this logic using MSBuild tasks and then run a csproj file that would find the solutions files and build them.

          Hope it helps

          Lionel Cabasson added a comment - Hello, For this purpose, I suggest you look at the pipeline-plugin as said in this topic . This could let you script a loop to run the build step multiple times. You can also consider creating a master solution file that will build the entire system. There is an article on MSDN about this stuff (see "The Partitioned Single Solution Model"). If the solution files to build must be determined dynamicaly (because new solution are regularly created for example), you may also consider script this logic using MSBuild tasks and then run a csproj file that would find the solutions files and build them. Hope it helps

          I close this as "not a defect" since msbuild itself does only take a single projectfile.
          Solutions for this situation are not related to the plugin itself.

          Lionel Cabasson added a comment - I close this as "not a defect" since msbuild itself does only take a single projectfile. Solutions for this situation are not related to the plugin itself.

            Unassigned Unassigned
            vadivel Vadivel Natarajan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: