How to stop Visual Studio from "always" checking out solution files?

66,138

Solution 1

This happens when the following is in the .sln file:

GlobalSection(ExtensibilityGlobals) = postSolution
    MyGlobalProperty = AnyValue
EndGlobalSection

I found that Enterprise Library added one of these. I removed it, checked in the solution, closed then re-opened it, and no more automatic check out.

Solution 2

Just in case, like me, you couldn't get it to work and you find that one or more projects also get checked out, I found a simplier solution. Make a note of the project(s) that it keeps checking out. Go to File - Source Control - Change Source Control, and then unbind the projects in question. Click OK, Save All, then go back into Change Source Control and bind teh project back to the solution. Hopefully this will work for others

Solution 3

From memory, if you use the Tools, Options menu and select the Source Control, Environments panel there should be a few options for configuring the way the IDE interfaces with the version control.

I think some of these options control the checkout on open behaviour.

Solution 4

Allow the check-out and then compare both files. If VS added something like

<Service Include="{B4F97281-0DBD-4835-9ED8-7DFB966E87FF}" />

you are experiencing a VS bug with a solution in VS2008 but not ported to VS2005

Check this link for further details:

Solution 5

Although not preventing the problem in the first place, liberal use of the Team Foundation Power Tools "Undo Unchanged" command will (surprise surprise) undo the pending edit if no changes have been made.

Share:
66,138

Related videos on Youtube

CodeClimber
Author by

CodeClimber

Simone Chiaretta is an Italian .NET developer, architect, Subtext core member and with a passion for mountain climbing. He is also a book writer for Wrox and his main interest is ASP.NET MVC

Updated on March 05, 2020

Comments

  • CodeClimber
    CodeClimber about 4 years

    For apparently no reason, every time I open my solution, Visual Studio checks the sln file out.

    If I compare it to the previous version there are no changes. But this is really frustrating since everybody has the solution checked out.

    I'm using VS 2008 and TFS 2008, both SP2.

    Any idea on how I can stop this thing to happen? Or is a feature/bug of the TFS source control provider for VS?

    • Richard Berg
      Richard Berg almost 15 years
      When *.sln files have actual changes, they are a horrific nightmare to merge because the projects within are given arbitrary-but-not-unique IDs. I'm a big advocate for concurrent checkouts, but I keep most of our *.sln locked.
    • felickz
      felickz over 10 years
      THIS IS FIXED IN VS2013!!! I open same solution in 2012 and it checks out .sln, open in 2013 and it stays clear.
  • CodeClimber
    CodeClimber almost 15 years
    yes... they allow you to checkout automatically, prompt from checkout, or do nothing... but nothing that helps with this problem
  • Scott Marlowe
    Scott Marlowe almost 15 years
    can't you then just say "no, don't check out" when it prompts you?
  • CodeClimber
    CodeClimber almost 15 years
    I wish I was the only developer in the team... unfortunately I cannot rely an all developers being diligent
  • CodeClimber
    CodeClimber almost 15 years
    No project in the solution has this line of XML
  • veight
    veight about 11 years
    CodeClimber, every time you start VS it does an automatic check out and you want that to stop and turning off the automatic check out does option not fix the issue. What the?
  • Baldy
    Baldy about 10 years
    thanks for the link Nigel, all the team are experiencing this issue
  • VenerableAgents
    VenerableAgents over 9 years
    For those who don't have the "Environments" in their list of options, change your connection from "Local" to "Server" (source: stackoverflow.com/questions/26843300/…)
  • Jaider
    Jaider over 7 years
    Updated link for Team Foundation Power Tools: marketplace.visualstudio.com/…