One of my projects has Exec Copy
command to copy a file from one directory to another. We are intermittently seeing an issue where one of the process is locking a file and MsBuild is trying to execute a copy command on the same file. So, we are facing the error that the file is in use by another process.
We are suspecting that this is because of two different elements executing in parallel. Unless the first one finishes we do not want the second one to execute. Can we have two values for AfterBuild attribute like below.
Below are the projects: Project1.proj and Project2.proj. I want to use the target defined in Project2 into Project1. Project1.proj has a reference added for Projet2.proj
Project1.proj
<Target Name="TestTarget" AfterTargets="Build;TestTargetAnother" > ..... ..... </Target>
Project2.proj
<Target Name="TestTargetAnother" AfterTargets="Build" > ..... ..... </Target>