Avoiding the infamous locked .xap file when building Silverlight projects in TFS

Building Silverlight projects on the Team Foundation Server Build Agent can get messy when you have .xap files around. We stumbled across this issues with a colleague from work (Dani you know, that was you :D ) when automating the build agent for a client.

The solution is quite simple, even if not intuitive. What we need to do is to deny the build agent read access to the file avoiding to download it in the first place. So as the download process do not fail, we can perform the build without trying to overwrite a locked file.

Hope this helps.



7 Comments

  1. Dave Smits wrote:

    Great post ! But how can i deny access to the specific file?

  2. @Dave Smits

    Good question, I was in a hurry but I saw that question coming :) . You just need to open the source code in the Team Explorer being an administrator, right-click in the file and open the security tab. You will notice your build agent security permissions, select it and deny the read access.

  3. [...] digging around the net today, I found an article that saved the day. Thanks Corvalius! Here is the solution I implemented to resolve the [...]

  4. Joe Jo wrote:

    Sorry, to bug, but I could not find an entry to my Build Agent in security. Just an entry for Build Services. I also checked on Buld services and it has no members. So, I am still puzzled how to deny access to the build Agent using the Security Tab.

  5. @Joe Jo
    Hi Joe,

    If you have entered the security tab from the .xap file, you just need to set Deny to you “Build Services” (that is the build agent name).

    Greetings
    Federico

  6. [...] found the tip for the solution here. Published Friday, April 30, 2010 9:02 AM by jdanforth Filed under: VS2010, TFS, [...]