How to stop Visual Studio from "always" checking out solution files?
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.
Related videos on Youtube
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, 2020Comments
-
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 almost 15 yearsWhen *.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 over 10 yearsTHIS IS FIXED IN VS2013!!! I open same solution in 2012 and it checks out .sln, open in 2013 and it stays clear.
-
-
CodeClimber almost 15 yearsyes... they allow you to checkout automatically, prompt from checkout, or do nothing... but nothing that helps with this problem
-
Scott Marlowe almost 15 yearscan't you then just say "no, don't check out" when it prompts you?
-
CodeClimber almost 15 yearsI wish I was the only developer in the team... unfortunately I cannot rely an all developers being diligent
-
CodeClimber almost 15 yearsNo project in the solution has this line of XML
-
veight about 11 yearsCodeClimber, 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 about 10 yearsthanks for the link Nigel, all the team are experiencing this issue
-
VenerableAgents over 9 yearsFor 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 over 7 yearsUpdated link for Team Foundation Power Tools: marketplace.visualstudio.com/…