Why missing <SccProjectName> in project file cause “The project file is not bound to source control”

廉价感情. 提交于 2019-11-28 20:17:57

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>

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

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.

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!