I have one of the projects of my solution, depending on another solution: code that will not change frequently. To exclude this code from the main solution, I referenced the resulting il-merged dll and added the following code to the project file:
<Target Name="BeforeBuild"> <MsBuild Projects="$(PathToAnotherSolutionFile)" Properties="Configuration=$(Configuration)" Condition="!Exists($(AnotherSolutionDll))"/> </Target>
As a result, the external solution is built only once during a new check. This is the desired behavior, and it works as expected if it is run from the command line. But if, for some reason, the MsBuild task fails to build the solution from Visual Studio.
However, it is executed if in the project "Create Project" instead of one solution add one project.
Is there a meaningful explanation for this behavior, and is there a way around it?
source share