0

I have 4 dependent projects (.csproj) which need to be build first before this current project is built. I want to build dependent projects with some different configurations.

<ProjectReference Include="..\..\Database\Database.csproj">
      <Project>{1b760081-dd0b-4515-bebb-8495cb5edfa7}</Project>
      <Name>Database</Name>
    </ProjectReference>
    <ProjectReference Include="..\Common\Common.csproj">
      <Project>{14966c67-c28f-4db3-9e6c-f647236ecd34}</Project>
      <Name>Common</Name>

suppose i want to build database with prod-india.config and similarly common with prod-china.config how to do so i am using msbuild to exe to build it where i am passing the csporj of the main file along with the configuratuon

Ismael Padilla
  • 5,246
  • 4
  • 23
  • 35

1 Answers1

0

You can override some msbuild properties directly in the project reference:

<ProjectReference Include="..\..\Database\Database.csproj">
  <Project>{1b760081-dd0b-4515-bebb-8495cb5edfa7}</Project>
  <Name>Database</Name>
  <AdditionalProperties>Configuration=SomethingCustom</AdditionalProperties>
</ProjectReference>
Martin Ullrich
  • 94,744
  • 25
  • 252
  • 217