We are using TFS 2010 Build to deliver libraries on a fixed location. ( \\server\product-R0\latest )
Other team projects reference the library from this location.
On my build process I check if Build and unit tests passed, if it's ok I:
- Transform web/app.config
- Delete the latest folder using a "DeleteDirectory" activity
- Create the latest folder using a "CreateDirectory" activity
- Copy the binaries in the folder using "CopyDirectory" activity
I delete the folder first because if we rename an assembly the old one won't be deleted.
The issue is random and happen 40% of the time:
TF270002 : An error occurred copying files from 'D:\Builds\1\FooTeam\BarService\Binaries' to '\\nas\Builds\BarService-R0\Latest'.
Details : Access to the path '\\nas\Builds\BarService-R0\Latest\SomeFile.dll' is denied.
If you launch the build several times it work.
I've try the usual dumb idea of "putting sleeps between steps to see what happens" but it don't solve the problem, it just seems to reduce the probability of it happening.
It's like TFS try to copy while still deleting the directory, some times it hangs on the directory creation step.
Anyone? Thank you!