为什么缺少< SccProjectName>项目文件中的原因是“项目文件未绑定到源代码管理”。 [英] Why missing <SccProjectName> in project file cause "The project file is not bound to source control"

查看:388
本文介绍了为什么缺少< SccProjectName>项目文件中的原因是“项目文件未绑定到源代码管理”。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了一个非常烦人的问题,我找到了一个解决方案,但是我想问你为什么它的行为如此……

I had a very annoying problem, I have found a solution, but I would like to ask you why it behaves like that...

我正在使用Visual Studio 2012和TFS2012。一切都很好,但是有一天我发现了一个问题。当我在解决方案中添加了新项目后,每次重新打开解决方案时,我总是会收到此消息:

I am using Visual Studio 2012 with TFS 2012. Everything was fine, but one day I have spotted a problem. When I have added a new project to my solution, then I have always obtaining this message every time I have reopened the solution:


该项目文件...未绑定到源代码管理,但解决方案包含它的源代码管理绑定信息。您想要...

This project file ... is not bound to source control, but the solution contains source control binding information for it. Do you want...

无论我做什么,我仍然收到此消息。在文件->源代码控制->高级->更改源代码控制...窗口中,一切都很好。 * .vspscc文件已正确创建且内容良好。我正在删除绑定并一次又一次地添加它,但这没有帮助。一直以来,我都收到这个令人讨厌的消息……

Whatever I have done, I still have this message. In the File->Source Control->Advanced->Change Source Control...' window every thing was fine. The *.vspscc files where properly created with good content. I was removing the binding and adding it again and again, but it was not helpful. All the time I had this annoying message...

然后我发现* .csproj文件有一个区别。我有问题的项目没有以下XML数据:

And then I have spotted one difference in the *.csproj files. My problematic project did not have the following XML data:

<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>

当我添加这些行时,问题就解决了...

When I have added those lines, problem was solved...

有没有人可以告诉我为什么这些元素丢失了,为什么它们导致这种永无休止的问题,以及有关解决方案绑定的烦人消息?

Is there anyone who can tell me why those elements where missing and why they cause such never-ending problem with annoying message about solution binding?

谢谢

推荐答案

之所以会发生这种情况,是因为解决方案文件中包含源代码控制信息,而.csproj文件将仅实现

This happens because the Solution file has the Source Control Information in it and the .csproj file will just implement what the solution file tells it.

<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>

SAK在从解决方案文件中提取信息时指的是应该已经知道。
解决方案文件应包含类似于下面显示的内容

The SAK referes to "Should Already Know" as it pulls the information from the solution file. The solution file should contain something similar to what is shown below

GlobalSection(TeamFoundationVersionControl) = preSolution
        SccNumberOfProjects = 4
        SccEnterpriseProvider = {3BA58AB2-18FA-4F8D-95D4-32DDF27D184A}
        SccTeamFoundationServer = http://TFSSERVER:8080/tfs/DPC
        SccLocalPath0 = .
        SccProjectUniqueName1 = Project1\\Project1.csproj
        SccProjectName1 = Project1
        SccLocalPath1 = Project1
        SccProjectUniqueName2 = Project2\\Project2.csproj
        SccProjectName2 = Project2
        SccLocalPath2 = Project2
        SccProjectUniqueName3 = Project3\\Project3.csproj
        SccProjectName3 = Project3
        SccLocalPath3 = Project3
        SccProjectUniqueName4 = Project4\\Project4.csproj
        SccProjectName4 = Project4
        SccLocalPath4 = Project4
    EndGlobalSection

现在会发生什么就是说,如果最先签入解决方案和项目的人员不包括Solution.vssscc文件,则Visual Studio无法确定源控件。如果发生这种情况,请删除vssscc文件并关闭解决方案。重新打开解决方案将创建一个新的vssscc文件,确保将此文件重新签入源代码管理。

Now what can happen is that if the person first checking in the solution and projects doesn't include the Solution.vssscc file then Visual Studio can't determine the source control. if this occurs delete the vssscc file and close the solution. reopening the solution will create a new vssscc file, ensure this gets checked back into source control.

添加项目时要检查的另一件事,请确保已检查解决方案文件

Another thing to check when adding a project make sure that the solution file gets checked out and then checked back in again when you submit the project.

只要解决方案文件和vssscc文件由源代码管理正确处理,那么在您添加新项目时它应该从解决方案文件中获取源代码控制设置,然后将SCC节点应用于新项目

As long as the solution file and vssscc file are handled correctly by source control then when you add a new project it should pick up the source control settings from the solution file and then apply the SCC Nodes to the new project

这篇关于为什么缺少&lt; SccProjectName&gt;项目文件中的原因是“项目文件未绑定到源代码管理”。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆