Re-establish TFS source control bindings

前端 未结 10 1116
别跟我提以往
别跟我提以往 2020-11-29 02:16

I have about a dozen Visual Studio 2010 projects I\'ve been working on that are versioned in a TFS repository. Recently I went on a vacation and upgraded my computer\'s OS t

10条回答
  •  北海茫月
    2020-11-29 02:51

    If your're still fighting with TFS binding invalid status I report here a "gem" I've found in an old (2005) MSDN forum (https://social.msdn.microsoft.com/Forums/en-US/801b2490-776d-43a8-afef-adcedd78f02d/vsts-change-source-control-status-invalid?forum=tfsgeneral):

    This is due to a heuristic used in the validation code for binding. The heuristic does an existence check for all of the files in the project and will only return "valid", if at least half of the files are present in the source control repository. Since web projects have no project file, any file residing in the web project folder is considered "part of the project". Apparently you had enough uncontrolled files to tilt the percentage of controlled project files to under 50%, thus causing an invalid status.

    In other words, if you have a project that has many files uncontrolled (this is especially true when you opt-out check-in for folders like node_modules or public in a web project) and the number of these files are more than 50% of the total files in the folder, TFS binding status are invalid whatever you do.

    I could verify this rule just removing the correct number of files until the binding status became invalid and just adding a new one (uncontrolled) get the invalid status.

    This behavior is still present in VS 2019 6.3 (Azure DevOps).

    I don't know if there is a way to disable this heuristic, but I'm pretty sure that it's a fake Invalid status, i.e. tfs binding is actually working correctly and that is just an erroneous message.

提交回复
热议问题