Monday, August 20, 2012

TFS Build failed - Access to the path is denied

TFS Build failed when trying to build project because of the following error:
Copying file
C:\Builds\Agent\MyPrj\Binaries\Abc.Client.Silverlight.xap failed.
Access to the path 'C:\Builds\Agent\MyPrj\Sources\Dev\Abc.Client.Silverlight.Web\ClientBin\Abc.Client.Silverlight.xap'
is denied

Open your TFS source control in your Silverlight project ClientBin directory and check you didn't checked-in your xap files (in this case: Abc.Client.Silverlight.xap). If checked-in, delete it from the source control.
This error can occur in other projects types (not only Silverlight) when you checked-in files in a build deployment folder. Those files are copied into the build server as Read Only and cannot be overwritten later when the build server trying to deploy them

If you find this solution useful, you are welcome to press one of the ads in this page.. Thanks!


  1. Life saver!
    My other team members had checked-in bin and obj folders.
    I had to delete them from TFS source control window via Visual Studio 2010.

  2. I had been pulling my hair for too long, thanks for not letting me go full bald.