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

Visual Studio-2008Tfs

Visual Studio-2008 Problem Overview


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?

Visual Studio-2008 Solutions


Solution 1 - Visual Studio-2008

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 - Visual Studio-2008

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 3 - Visual Studio-2008

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 4 - Visual Studio-2008

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 - Visual Studio-2008

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.

Solution 6 - Visual Studio-2008

The Visual Studio Solution file is being silently checked-out through one or more of the Solution's Projects using the Microsoft Enterprise Library - I believe this is something to do with the Enterprise Library Configuration Utility which allows the configuration management of the various Application Blocks - http://msdn.microsoft.com/en-us/library/ff649479.aspx

See this Microsoft Feedback posting: http://connect.microsoft.com/VisualStudio/feedback/details/737184/globalsection-extensibilityglobals-postsolution-checks-out-sln-file-on-open

Solution 7 - Visual Studio-2008

It is a feature/bug of one of the project systems being loaded within the solution. Try removing various types of projects (C#, VB, C++, web site, web app, unit test, silverlight...) until it goes away; that's your answer.

Solution 8 - Visual Studio-2008

Are you saving your files before do the comparison? It happened with me some time ago and keep saying there are no changes between the files, but after some time I realize I wasn't saving the files before and it was comparing with the version in disk, not the version in memory.

Every time you open some solution in Visual Studio, it performs some operations which may cause your .sln or project files change and then it will ask you to check out the file. It happens when there are changes in the folder structure in the developers machine, or when they don't have the same versions of all the files. Maybe someone added a project in some folder and another developer has the same project in another place. Another case I see this happen was when we have an solution with some c++ projects, for some reason, one of this c++ projects had a .res file with absolutes paths. Once this file was generated automatically by VS it kept change from developer machine to developer machine.

I would suggest you to open your .sln file and look for some absolute paths or by relative paths which may not exist in some developer machine, depending what files they Get from yours Source Control.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionCodeClimberView Question on Stackoverflow
Solution 1 - Visual Studio-2008Graham ClarkView Answer on Stackoverflow
Solution 2 - Visual Studio-2008jussijView Answer on Stackoverflow
Solution 3 - Visual Studio-2008JJ76View Answer on Stackoverflow
Solution 4 - Visual Studio-2008Luis FilipeView Answer on Stackoverflow
Solution 5 - Visual Studio-2008Dave RobertsView Answer on Stackoverflow
Solution 6 - Visual Studio-2008Nigel BelhamView Answer on Stackoverflow
Solution 7 - Visual Studio-2008Richard BergView Answer on Stackoverflow
Solution 8 - Visual Studio-2008CarlosView Answer on Stackoverflow