Visual-studio – Why would VS2005 keep checking out a project for editing without any changes being made

visual-studio-2005

I have a VS2005 solution which contains a variety of projects (C++ DLLs, C++ static libraries, C# assemblies, C++ windows executables) that are combined in various ways to produce several executables. For some reason, every time I open the solution, VS2005 wants to check out one of the projects for editing. The project is not modified in any way, it's just checked out. If I configure VS2005 to prompt before checking out, I can cancel the auto-checkout during load with no ill effect that I can see. It may or may not be relevant, but the project it keeps checking out is cppunit version 1.12.0 (the static lib version). How can I stop this annoying behavior?

Other potentially relevant (or not) details:

  • Source control is Team Foundation Server (not Visual SourceSafe)
  • no .suo or .ncb files are checked in
  • the .vcproj and .vspscc files are being checked out
  • When I close the solution or shut down Visual Studio, I'm asked whether I want to save changes to the project. Answering yes results in no changes to the file (Kdiff3 compares my local file to the server version and reports"files are binary equal")
  • Attempting to check in the "modified" files results in a Visual Studio message saying "No Changes to Check In. All of the changes were either unmodified files or locks. The changes have been undone by the server"

Best Answer

There are two reasons I've encountered that cause this behavior.

The first is old source control bindings. If you have a project that used to be managed by another source control tool, it might have leftover bindings in the project file. Open the project file, and change the following settings from something like this:

  • SccProjectName="$/Team/Platform/Projects/MyProject"
  • SccAuxPath="http://teamFoundationServer.example.com:8080"
  • SccLocalPath="."
  • SccProvider="{88888888-4444-4444-4444-BBBBBBBBBBBB}"

to this:

  • SccProjectName="SAK"
  • SccAuxPath="SAK"
  • SccLocalPath="SAK"
  • SccProvider="SAK"

Different project types are defined in different ways. The above example is from a .vcproj, C# projects are in XML, VB looks like something else, but the meanings are the same. Simply set all four values to the constant string "SAK" and Visual Studio will automatically handle source control. See Alin Constantin's blog for details.

I haven't yet discovered the root of the other reason, but the project that is giving me trouble is also CppUnit 1.12.0! I'll keep digging and post my findings.

John