visual-studio 向 Team Foundation Server 2010 添加解决方案时显示警告

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/934263/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 10:35:19  来源:igfitidea点击:

Warning displayed when adding solution to Team Foundation Server 2010

visual-studioversion-controltfs

提问by Calanus

I'm just getting to grips with TFS 2010 (never had any luck with TFS 2008) and I'm trying to add my first solution into TFS. However I am getting the following warning message:

我刚刚开始使用 TFS 2010(从来没有使用过 TFS 2008),我正在尝试将我的第一个解决方案添加到 TFS 中。但是,我收到以下警告消息:

The project that you are attempting to add to source control may cause other source control users to have difficulty opening this solution or getting newer versions of it. To avoid this problem, add the project from a location below the binding root of the other source controlled projects in the solution.

您尝试添加到源代码管理的项目可能会导致其他源代码管理用户难以打开此解决方案或获取它的更新版本。为避免此问题,请从解决方案中其他源代码控制项目的绑定根下方的位置添加项目。

Can someone explain to me what this means and how to resolve it? This warning is displayed when right clicking on the solution in Solution Explorer and selecting "Add to Source Control".

有人可以向我解释这意味着什么以及如何解决吗?右键单击解决方案资源管理器中的解决方案并选择“添加到源代码管理”时会显示此警告。

采纳答案by Mitch Wheat

Your solution folder structure should resemble:

您的解决方案文件夹结构应类似于:

Solution Root folder
    | 
    .sln solution file       
    |
    Project1 folder
         |
         Project1.csproj   (or .vbproj)
    |
    Project2 folder
         |
         Project2.csproj   (or .vbproj)
    .
    .
    .

回答by cdburgerjr

As described in this Visual Studio forum post (link below), the basic issue is that a project in the solution is outside of the sub-tree that the solution itself is in. This can possibly lead to problems if another user maps the different subtrees differently in his workspaces than the user that is checking in. The cross-tree references will no longer work. The dialog is only a warning, but can be continued if you know your team doesn't split up the code tree with complex workspace mappings.

正如这个 Visual Studio 论坛帖子(下面的链接)中所述,基本问题是解决方案中的项目位于解决方案本身所在的子树之外。如果另一个用户映射不同的子树,这可能会导致问题在他的工作区中与正在签入的用户不同。跨树引用将不再起作用。该对话框只是一个警告,但如果您知道您的团队没有使用复杂的工作区映射拆分代码树,则可以继续。

https://social.msdn.microsoft.com/Forums/vstudio/en-US/29579a28-9de0-4fc6-a253-b38191aa4fdc/must-projects-be-added-under-binding-root-of-solution?forum=tfsversioncontrol

https://social.msdn.microsoft.com/Forums/vstudio/en-US/29579a28-9de0-4fc6-a253-b38191aa4fdc/must-projects-be- added-under-binding-root-of-solution?forum= tfs版本控制

回答by Bruno Bieri

For me it was like this that I tried to add the solution from another location already. I then had to clean the workspace which was created for the other location.

对我来说就是这样,我已经尝试从另一个位置添加解决方案。然后我必须清理为其他位置创建的工作区。

For Visual Studio 2013 you can find the workspace settings under:

对于 Visual Studio 2013,您可以在以下位置找到工作区设置:

File -> Source Control -> Advanced -> Workspaces...
  1. On the Manage Workspacesdialog select your workspace you work with
  2. Hit Edit....
  3. On the Edit Workspace <yourworkspacename>dialog
  4. clear the "wrong"location
  1. Manage Workspaces对话框中选择您使用的工作区
  2. 击中Edit...
  3. Edit Workspace <yourworkspacename>对话框上
  4. 清除“错误”位置

Try to add the solution again.

尝试再次添加解决方案。

回答by Mike Christian

The following issue can sympomatically manifest the error you reported. Remember, referenced assemblies need not be in any specific location in either TFS or in the file system of your workstation.

以下问题可以象征性地体现您报告的错误。请记住,引用的程序集不需要位于 TFS 或工作站文件系统中的任何特定位置。

An underlying problem is that some types of projects default to the "Client" version of the targeted .NET Framework. The Clientversions strip out assemblies that are usually not used in deployable projects. Furthermore, any assembly your project references must also not reference assemblies omitted by the Clientprofile.

一个潜在的问题是某些类型的项目默认使用目标 .NET Framework的“客户端”版本。该客户端版本去掉了通常不部署项目中使用的组件。此外,您的项目引用的任何程序集也不得引用客户端配置文件省略的程序集。

Simply change the Target framework setting of your project to the full framework version.

只需将项目的目标框架设置更改为完整框架版本。

Check out my blog post, regarding this issue: http://thecurlybrace.blogspot.com/2010/09/visual-studio-wears-sabots.html

查看我的博客文章,关于这个问题:http: //thecurlybrace.blogspot.com/2010/09/visual-studio-wears-sabots.html