none
VSTS Change Source Control - Status Invalid

    Question

  • Trying to move over from VSS to VSTS Source Control. Rather than a migration, we decided to start clean. We have a solution with 3 C# library class projects and one web site. The when linking to source control, the solution file, along with the 3 projects that are based on the C# libary class projects are bound , connected and their status is 'Valid' (based on what is showing in the Change Source Control dialog box). However, the Web Site is bound, connected and 'Invalid'. I can check files in and out of the web site folders. The appropriate icons appear for 'locked' and 'checked out' in the Solution Explorer. Anyone know of a reason why it's status is 'Invalid'???

    Much thanks for anyone who can shed some light on this!

    -Vinny Davi
    Monday, October 10, 2005 5:54 PM

Answers

  • Well, it turns out, that if you have files within that directory prior to getting latest from VSTS source control, it deems it as invalid. so if you delete all files and leave an empty stub directory, do a get latest, and then add your non VSTS Source Control files back to the directory , all is well.

    -Vinny Davi
    Monday, October 10, 2005 6:43 PM
  • 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.

    I should note that this heuristic is a carryover from some of the legacy Visual Studio Source Control integration code that we used to integrate Team Foundation Version Control into VS.  We have been seriously considering whether such an arbitrary heuristic is applicable, and if it should be removed.

    Ben Ryan

    Monday, October 10, 2005 9:20 PM

All replies

  • Well, it turns out, that if you have files within that directory prior to getting latest from VSTS source control, it deems it as invalid. so if you delete all files and leave an empty stub directory, do a get latest, and then add your non VSTS Source Control files back to the directory , all is well.

    -Vinny Davi
    Monday, October 10, 2005 6:43 PM
  • 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.

    I should note that this heuristic is a carryover from some of the legacy Visual Studio Source Control integration code that we used to integrate Team Foundation Version Control into VS.  We have been seriously considering whether such an arbitrary heuristic is applicable, and if it should be removed.

    Ben Ryan

    Monday, October 10, 2005 9:20 PM
  • This stupid bug still seems to be present in 2008. If only we could stay with Subversion!

    Friday, May 02, 2008 10:53 AM
  • Wow! I just ran into this stupid heuristic, legacy code in VS 2010. 

    The workaround is - Use the Add to Source Control command instead of Bind command.

    Tuesday, August 16, 2011 6:55 PM
  • This drove me crazy for a while, I had a project which refused to let me add several files in it to source control.
    On the top level I could check-in / check-out but the files weren't part of source control.

    I (un)binded the project, removed and added the project, manually excluded the files from the project and tried to add them manually (this gave an 'The item $... already exists.' error) but it didn't help.
    Finally I unbinded and re-binded the solution and I was pleasantly surprised noticing all files in the project were under source control..

    Regards,

    Mike

    Wednesday, June 27, 2012 12:22 PM