Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7062165
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:33:40+00:00 2026-05-28T04:33:40+00:00

Multiple projects have to be build with one ore more configurations (debug/release/…). The output

  • 0

Multiple projects have to be build with one ore more configurations (debug/release/…).

The output of the build needs to be copied to a folder (BuildOutputPath).
There is a default BuildOutputFolder, but for some project you can indicate that the output needs to be put in a extra child folder.

For example:

Configuration are:
– debug
– release

The projects are:

  • Project1 (BuildOutputFolder)
  • Project2 (BuildOutputFolder)
  • Project3 (BuildOutputFolder\Child)

The end result should look like this:

\\BuildOutput\
     debug\
         project1.dll
         project2.dll
         Child\
               Project3.dll
     release\
         project1.dll
         project2.dll
         Child\
              Project3.dll

I got this far atm, but can’t figure out how to override the OutputPath per project.

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0" DefaultTargets="Build" >
  <ItemGroup>
    <ConfigList Include="Debug" />
    <ConfigList Include="Release" />
   </ItemGroup>  

  <PropertyGroup>
    <BuildOutputPath>$(MSBuildProjectDirectory)\BuildOutput\</BuildOutputPath>
  </PropertyGroup>

  <ItemGroup>
    <Projects Include="project1.csproj" />
    <Projects Include="project2.csproj" />
    <Projects Include="project3.csproj" />
  </ItemGroup>

  <Target Name="Build">
    <MSBuild Projects="@(Projects)"
             BuildInParallel="true"
             Properties="Configuration=%(ConfigList.Identity);OutputPath=$(BuildOutputPath)%(ConfigList.Identity)" />

  </Target>
</Project>

How would you accomplish this in a MSBuild project file ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T04:33:41+00:00Added an answer on May 28, 2026 at 4:33 am

    Your’e attempting to call a task recursively in two different contexts. 2 configurations and 3 projects requires 6 calls to the build task. You need to layout the project in such a way that for each item in ConfigList a call is made multiplied by each item in Projects.

    Also use ItemDefinitionGroup to set default shared properties:

      <ItemGroup>
        <ConfigList Include="Debug" />
        <ConfigList Include="Release" />
      </ItemGroup>
    
       <ItemDefinitionGroup>
        <Projects>
          <BuildOutputPath>$(MSBuildProjectDirectory)\BuildOutput\</BuildOutputPath>
        </Projects>
      </ItemDefinitionGroup>
    
      <ItemGroup>
        <Projects Include="project1.csproj" />
        <Projects Include="project2.csproj" />
        <Projects Include="project3.csproj" >
          <Subfolder>Child</Subfolder>
        </Projects>
      </ItemGroup>
    
      <Target Name="Build">
    
        <MSBuild Projects="$(MSBuildProjectFullPath)"
                 Targets="_BuildSingleConfiguration"
                 Properties="Configuration=%(ConfigList.Identity)" />
    
      </Target>
    
      <Target Name="_BuildSingleConfiguration">
    
        <MSBuild Projects="@(Projects)"
                 BuildInParallel="true"
                 Properties="Configuration=$(Configuration);OutputPath=%(Projects.BuildOutputPath)$(Configuration)\%(Projects.Subfolder)" />
      </Target>
    
    </Project>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have read that to build multiple Maven projects in one step (with automatic
my solution has multiple projects and in one of them I have the code
I have a solution in Visual Studio 2008 which has multiple projects. One of
I have multiple configurations set up in Visual Studio so that I can build
In my build configuration I have multiple project queues: Queue1, Queue2, ... Queue(N) I
I have multiple projects in a couple of different workspaces. However, it seems like
Most of our Eclipse projects have multiple source folders, for example: src/main/java src/test/java When
Many times I have seen Visual Studio solutions which have multiple projects that share
I have a solution with multiple projects and we need to do some serious
I have some code shared among multiple projects in a static library. Even with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.