Sunday, 6 August 2006

Access is denied. in VSTS Team Build

A wise man once said "A man who never made a mistake, never made anything", well I've just made a fundamental error and learned a lot from it.

I've been using Team Build to build projects and recently kept getting "Access is denied." on files in either a project's obj directory or in the bin directory. This didn't happen for all the projects within a solution, just one or two. Checking the security within the build server showed that all the directories for all the projects had the same security settings. It took me a while to figure out what was happening!

Some time during the lifetime of the project Visual Studio had crashed . I had some projects that were in the solution but had not been added to source control correctly. To fix this I went through and added the folders containing the projects to source control, then checked everything in. This was the mistake. When I added the folder it also meant I added the binary files, i.e. the files in the obj and bin folders. During a build the buildserver checks out the files defined in the workspace mappings, including the binaries that I had now added. These files are checked out as read-only. Of course, when the project was built, as the binaries were read-only they could not over-written so the build was failing.

Deleting the binaries from source control fixed the problem. And the moral of the story is, don't put anything into source control that wil be re-built as part of the standard project build!

Posted by kevin at 11:10 AM in Net

 

Your comment:

SCode: (*) Generate another code
SCode

Please enter the code as seen in the image above to post your comment.

(not displayed)
 
 
 

Live Comment Preview:

 
« August »
SunMonTueWedThuFriSat
  12345
6789101112
13141516171819
20212223242526
2728293031