title: MSBuild task - Build fails because one solution being built in release instead of debug
body: <p>I'm hitting a weird issue with <a href="http://en.wikipedia.org/wiki/MSBuild" rel="nofollow noreferrer">MSBuild</a>, and I'm thinking it might just be an environment issue. We're using MSBuild to build a number of separate solutions, and it seems to work on my machine. But on a couple of other machines, it's not working.</p>
  
  <p>I've tracked down the issue, and it looks like one of the solutions (or one of the projects in that solution) is being built in "Release" when everything else is being built in "Debug". This causes some of the references to be missing - so the solution being built in "Release" fails to build. I want all solutions to be built in "Debug". In the following is our current TFSBuild.proj file - what are we doing wrong?</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;Project DefaultTargets="DesktopBuild" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt;
      &lt;!-- TO EDIT BUILD TYPE DEFINITION
  
          To edit the build type, you will need to edit
          this file which was generated by the Create New
          Build Type wizard.  This file is under source
          control and needs to be checked out before
          making any changes.
  
          The file is available at -
  
              $/{TeamProjectName}/TeamBuildTypes/{BuildTypeName}
  
          where you will need to replace TeamProjectName
          and BuildTypeName with your Team Project and
          Build Type name that you created
  
          Checkout the file
  
            1. Open Source Control Explorer by selecting
               View -&gt; Other Windows -&gt; Source Control Explorer
  
            2. Ensure that your current workspace has a mapping for
               the $/{TeamProjectName}/TeamBuildTypes folder and
               that you have done a "Get Latest Version" on that
               folder
  
            3. Browse through the folders to
               {TeamProjectName}-&gt;TeamBuildTypes-&gt;{BuildTypeName} folder
  
            4. From the list of files available in this folder, right
               click on TfsBuild.Proj. Select 'Check Out For Edit...'
  
          Make the required changes to the file and save
  
          Checkin the file
            1. Right click on the TfsBuild.Proj file
               selected in Step 3 above and select
               'Checkin Pending Changes'
  
            2. Use the pending checkin dialog to save your
               changes to the source control
  
          Once the file is checked in with the
          modifications, all future builds using this
          build type will use the modified settings
      --&gt;
  
      &lt;!-- Do not edit this --&gt;
      &lt;Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v8.0\TeamBuild\Microsoft.TeamFoundation.Build.targets" /&gt;
      &lt;ProjectExtensions&gt;
  
          &lt;!--  DESCRIPTION
              The description is associated with a build
              type. Edit the value for making changes.
          --&gt;
          &lt;Description&gt;
          &lt;/Description&gt;
  
          &lt;!--  BUILD MACHINE
              Name of the machine which will be used to
              build the solutions selected.
          --&gt;
          &lt;BuildMachine&gt;xxxx-test&lt;/BuildMachine&gt;
      &lt;/ProjectExtensions&gt;
      &lt;PropertyGroup&gt;
  
        &lt;!--  TEAM PROJECT
            The team project which will be built using
            this build type.
        --&gt;
        &lt;TeamProject&gt;CFAST&lt;/TeamProject&gt;
  
        &lt;!--  BUILD DIRECTORY
            The directory on the build machine that will
            be used to build the selected solutions. The
            directory must be a local path on the build
            machine (e.g. c:\build).
        --&gt;
        &lt;BuildDirectoryPath&gt;C:\Build\brtcn&lt;/BuildDirectoryPath&gt;
        &lt;SolutionRoot Condition=" '$(IsDesktopBuild)'!='true' "
        &gt;$(BuildDirectoryPath)\w&lt;/SolutionRoot&gt;
  
        &lt;!--  DROP LOCATION
            The location to drop (copy) the built binaries
            and the log files after the build is complete.
            This location has to be a valid UNC path of
            the form \\Server\Share. The build machine
            service account and application tier account
            need to have read write permission on this
            share.
        --&gt;
        &lt;DropLocation&gt;\\my-files\xx-files\Build Drop\xx&lt;/DropLocation&gt;
  
        &lt;!--  TESTING
            Set this flag to enable/disable running tests
            as a post build step.
        --&gt;
        &lt;RunTest&gt;false&lt;/RunTest&gt;
        &lt;!--  WorkItemFieldValues
            Add/edit key value pairs to set values for
            fields in the work item created during the
            build process. Please make sure the field
            names are valid for the work item type being
            used.
        --&gt;
        &lt;WorkItemFieldValues&gt;Symptom=build break;Steps To Reproduce=Start the build using Team Build&lt;/WorkItemFieldValues&gt;
        &lt;!--  CODE ANALYSIS
            To change CodeAnalysis behavior edit this
            value. Valid values for this can be
            Default,Always or Never.
  
            Default - To perform code analysis as per the individual project settings
            Always  - To always perform code analysis irrespective of project settings
            Never   - To never perform code analysis irrespective of project settings
         --&gt;
        &lt;RunCodeAnalysis&gt;Never&lt;/RunCodeAnalysis&gt;
  
        &lt;!--  UPDATE ASSOCIATED WORK ITEMS
         Set this flag to enable/disable updating associated workitems on a successful build
        --&gt;
        &lt;UpdateAssociatedWorkItems&gt;true&lt;/UpdateAssociatedWorkItems&gt;
        &lt;!-- Title for the work item created on build failure --&gt;
        &lt;WorkItemTitle&gt;Build failure in build:&lt;/WorkItemTitle&gt;
        &lt;!-- Description for the work item created on build failure --&gt;
        &lt;DescriptionText&gt;This work item was created by Team Build on a build failure.&lt;/DescriptionText&gt;
        &lt;!-- Text pointing to log file location on build failure --&gt;
        &lt;BuildlogText&gt;The build log file is at:&lt;/BuildlogText&gt;
        &lt;!-- Text pointing to error/warnings file location on build failure --&gt;
        &lt;ErrorWarningLogText&gt;The errors/warnings log file is at:&lt;/ErrorWarningLogText&gt;
      &lt;/PropertyGroup&gt;
      &lt;ItemGroup&gt;
          &lt;!--  SOLUTIONS
              The path of the solutions to build. To
              add/delete solutions, edit this value. For
              example, to add a solution MySolution.sln,
              add following line -
               &lt;SolutionToBuild Include="C:\Project Files\path\MySolution.sln" /&gt;
  
              To change the order in which the solutions are build, modify the order in
              which the solutions appear below.
          --&gt;
          &lt;SolutionToBuild Include="..\..\xx1\xxx\Solution\xxx Solution.sln" /&gt;
          &lt;SolutionToBuild Include="..\..\xx2\Build Solutions\xx xx xx Build\Data Port Common Build.sln" /&gt;
          &lt;SolutionToBuild Include="..\..\xx3\Build Solutions\xxx Build\xxx Build.sln" /&gt;
      &lt;/ItemGroup&gt;
      &lt;ItemGroup&gt;
          &lt;!--  CONFIGURATIONS
              The list of configurations to build. To
              add/delete configurations, edit this value.
              For example, to add a new configuration, add
              following lines -
                  &lt;ConfigurationToBuild Include="Debug|x86"&gt;
                      &lt;FlavorToBuild&gt;Debug&lt;/FlavorToBuild&gt;
                      &lt;PlatformToBuild&gt;x86&lt;/PlatformToBuild&gt;
                  &lt;/ConfigurationToBuild&gt;
  
              The Include attribute value should be unique
              for each ConfigurationToBuild node.
          --&gt;
          &lt;ConfigurationToBuild Include="Debug|Any CPU"&gt;
              &lt;FlavorToBuild&gt;Debug&lt;/FlavorToBuild&gt;
              &lt;PlatformToBuild&gt;Any CPU&lt;/PlatformToBuild&gt;
          &lt;/ConfigurationToBuild&gt;
      &lt;/ItemGroup&gt;
      &lt;ItemGroup&gt;
          &lt;!--  TEST ARGUMENTS
              If the RunTest is set to true then the
              following test arguments will be used to run
              tests.
  
              To add/delete new testlist or to choose a
              metadata file (.vsmdi) file, edit this
              value. For e.g. to run BVT1 and BVT2 type
              tests mentioned in the Helloworld.vsmdi
              file, add the following -
  
              &lt;MetaDataFile Include="C:\Project Files\HelloWorld\HelloWorld.vsmdi"&gt;
                  &lt;TestList&gt;BVT1;BVT2&lt;/TestList&gt;
              &lt;/MetaDataFile&gt;
  
              Where BVT1 and BVT2 are valid test types
              defined in the HelloWorld.vsmdi file.
  
                  MetaDataFile - Full path to test metadata file.
                  TestList - The test list in the selected metadata file to run.
  
              Please note that you need to specify the
              vsmdi file relative to $(SolutionRoot)
          --&gt;
          &lt;MetaDataFile Include=" "&gt;
              &lt;TestList&gt; &lt;/TestList&gt;
          &lt;/MetaDataFile&gt;
      &lt;/ItemGroup&gt;
      &lt;ItemGroup&gt;
        &lt;!--  ADDITIONAL REFERENCE PATH
            The list of additional reference paths to use
            while resolving references.
  
            For example,
                &lt;AdditionalReferencePath Include="C:\MyFolder\" /&gt;
                &lt;AdditionalReferencePath Include="C:\MyFolder2\" /&gt;
        --&gt;
        &lt;AdditionalReferencePath Include="..\..\xxxx\Reference Files" /&gt;
        &lt;AdditionalReferencePath Include="..\..\xxxx\Build Support\SomeCoolLibrary" /&gt;
        &lt;AdditionalReferencePath Include="..\..\xxxx1.1\Reference Files " /&gt;
      &lt;/ItemGroup&gt;
  &lt;/Project&gt;
  </code></pre>