views:

27

answers:

1

I have two solutions that I want to include in a build. Solution two requires the dll's from solution one to successfully build. Solution two has a Binaries folder where the dll's from solution one need to be copied before building Solution two.

I've been trying an AfterBuild Target, hoping that it would copy the items after the first SolutionToBuild, but it doesn't fire then. I'm guessing that it would probably fire after both solutions have compiled, but that's not what I want.

<SolutionToBuild Include="$(BuildProjectFolderPath)/../../Main/Framework.sln">
  <Targets>AfterCompileFramework</Targets>
  <Properties></Properties>
</SolutionToBuild>
<SolutionToBuild Include="$(BuildProjectFolderPath)/../../../Dashboard/Main/Dashboard.sln">
  <Targets></Targets>
  <Properties></Properties>
</SolutionToBuild>

<ItemGroup>
  <FrameworkBinaries Include="$(DropLocation)\$(BuildNumber)\Release\Framework.*.dll"/>
</ItemGroup>
<Message Text="FrameworkBinaries: @(FrameworkBinaries)" Importance="high"/>

<Copy SourceFiles="@(FrameworkBinaries)" DestinationFolder="$(BuildProjectFolderPath)/../../../Dashboard/Main/Binaries"/>

A: 

Combine the projects from both solutions into a single solution, then add a project reference to the dependent project. Copying the assemblies now happens automatically.

The primary reason for solutions is to manage build dependencies between projects.

I would use two solutions when I did not want development on one project to effect development on another. In this case I would manually copy the output from solutions one and check it in as a dependency for solution two as needed. If you want the output from one to be automatically used as the input for another then you would be best served with a single solution.

Blake Taylor