开发者

TFS and local folder permission problem

Environment: VS 2010, Windows 7, TFS

I have a solution1 with solution filder called Binaries(which is a physical path on local computer, say it's c:\Binaries): I put all external assesmblies in this folder.

In another solution2, for each class library project in this solution, set property->build->Output path to c:\Binaries, so that the latest version of these assemblies can be referenced by any project in solution1

It's working fine.

Now I put solution1 and solution2 to TFS and all of them are under TFS source control, include Binaries folder.

Now I open solution 2 again and build the solution2, it give me permission error for each class library project like:

Error 49 Unable to copy file "obj\Debug\mycomponent.dll" to "....\Binaries\mycomponent.dll". Access t开发者_StackOverflowo the path '....\Binaries\mycomponent.dll' is denied.

But if I check the permission in windows 7 on c:\Binaries, no problem. So it should be something wrong with VS 2010 or TFS.

How to fix this problem?


Though I'm not a big advocate of binaries in your source control, there's a workaround for this.

  • When you get your source, you will need to specifically check out the binaries (to enable write access).

HOWEVER! If you have multiple developers working, this will (by default) put an exclusive lock on the binary files. And they will not be able to check out the files for edit.

The solution for this is in Visual Studio 2010. Go to

Team->Team Project Collection Settings->Source Control File Types and find "Executable Files" on the list. Change File Merging to Enabled and you'll be able to have shared locks on the file.

The other option is to either not "get" your binaries folder, or, if you do get it, "unget" it using

tf get "$/blah/project/Binaries" /server:servername /version:C1 /overwrite /force

You'll need to supply the itempsec and servername. This will get the first version of the binaries, which doesn't exist, so it will wind up deleting them locally and marking them as not gotten (or checked out).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜