Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

People also ask

What is check out in Visual Studio?

Check Out: Prevent other users from checking out and checking in the items until you check in and unlock them. In Visual Studio Team Foundation Server 2012 this option is not available if you are using a local workspace. Also, this lock is not enforceable because other users might be using local workspaces.

Do you need a solution file in Visual Studio?

You don't have to use solutions or projects in Visual Studio to edit, build, and debug code. You can simply open the folder that contains your source files in Visual Studio and start editing. For more information, see Develop code in Visual Studio without projects or solutions.

What is the use of solution file in Visual Studio?

A solution is a structure for organizing projects in Visual Studio. The solution maintains the state information for projects in two files: . sln file (text-based, shared)


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.


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.


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


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.


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: