It seems that when TFS does a build, when it creates the build directory and pulls the files down from source, it is marking all the source files as read only. This is causing a problem with a BizTalk solution that we have, it looks like at build time biztalk generates/edits a cs class for mapping files, and this is the same type of file that gets and unauthorized access exception during the build if it is marked as readonly. But for the life of me, and cannot figure out how to change this behavior of the TFS. Any ideas?
+3
A:
The files are marked readonly, because it is doing a get latest version from TFS. If BizTalk is generating a file during compilation, you can either not include this file in Source Control, or you can remove the readonly flag of that file.
You can remove the flag in TFS 2010 by editing the Build Process Template and add an InvokeProcess activity to execute the attrib -r command.
For more information how to add the InvokeProcess to the build process template see http://www.ewaldhofman.nl/post/2010/04/27/Customize-Team-Build-2010-e28093-Part-2-Add-arguments-and-variables.aspx
Ewald Hofman
2010-09-10 03:55:01