views:

29

answers:

1

I am building two solutions with MSBuild:

<ItemGroup> 
    <SolutionToBuild Include="$(BuildProjectFolderPath)/HostASPX/SolutionA.sln"/>    
    <SolutionToBuild Include="$(BuildProjectFolderPath)/../Installer/SolutionB.sln"/>     
  </ItemGroup>  

It seems that this build fails with the error message:

Unable to remove directory "c:\TeamBuild\Team Solutions\Solution\Binaries". The directory is not empty.

It appears that MSBuild creates this 'Binaries' directory by default and the build passes. When I build again the build fails with the above message. If I try a 3rd build.. it works again.

Can someone tell me how to ensure that his folder is deleted/overwritten each time?

+1  A: 

You sure there isnt a Hiesenberg issue? i.e.,something isnt locking the directory like explorer.exe :P

You can rule it out by using sysinternals procmon (to find out who is doing what to the dir) and procexp (to find out who is locking it).

Ruben Bartelink