问题
I've modified the default template to run some custom activities in the build process.
In the build process some CodeAnalysisRuleset files are created and shall be assigned to the corresponding c# projectfiles.
I have implemented two code activies to create (first activity) and assign the rulesets (second activity).
If I run the teambuild, an exception happened ("access denied"). I looked in the source folder on the build agent and the files are readonly.
The two code activities are placed after the "If CreateLabel" - activity because I though the files are already checked out at this point.
When are the files are getting checked out so i can modify them?
Is it the right way to accomplish my goal ?
回答1:
By default the files are actually never checked out.
The real question is: would you like after your actions have taken place, to also have the changes checked in?
If yes, check this Hofman - post that describes how to check out & check in during TFS build.
If no, you can simply add an additional step to make the target file(s) read-write during build. Please check my answer in this post, where in the first section I had described how we 've implemented this in our build process template with custom activity MakeFileWriteable
.
Generally speaking I tend to see checking-in during build as a horrible thing to do, so i've managed to avoid this so far.
来源:https://stackoverflow.com/questions/8577879/checkout-files-in-teambuild-tfs2010