我不了解 TFS,但是每当我为源代码控制的 VS 解决方案添加第三方库时,我通常会在解决方案文件夹中进行。
+-- MySolution
| // The solution is in source control
|
+-- MyProject1
| |
| +-- Project and source code files for a specific project
|
+-- MyProject1.Test
| |
| +-- Test files for MyProject1
|
+-- Third Party
| |
| +-- Library dll's are stored here.
|
|
+-- Solution files, more project folders, user settings (user settings are not in source control) etc…
当您指出第三方库时,它们应该通过相对路径链接。验证这一点的唯一方法是打开 *proj 文件并在依赖项标签下查看相关库是否与相对路径而不是绝对路径链接。
要将库添加到源代码管理中,您只需添加第三方文件夹。由于我没有使用 TFS,我不确定它是否会破坏这个设置(我使用 Subversion 或 Mercurial 作为源代码控制,它们运行良好)。