TFS automatically checks out a project when loaded - visual-studio-2010

This is very weird behavior of Visual studio and TFS. I am using Visual Studio 2012 and TFS 2012. We have a large number of projects and solutions in the source control.
Lets assume I have no pending changes.
Whenever I open solutions which are present on source control all projects are loaded. And not a single project is checked-out for edit. I can see lock icon with the projects in the solution explorer.
Now I create a new solution and add projects from the source control to this solution, I face weird behavior. Some of the projects are automatically checked out and I haven't did any change to it. And this happens to only few projects instead of all projects. If I call undo all pending changes TFS perform a undo but then calls checkout for the project.
What is the proper solution to it. And it happens only in custom solution (sln) which is not present in the source control.

Related

What's the use of binding in TFS

I got the latest version of a Visual Studio solution on TFS. But when I try to open the solution in Visual Studio I get the following message:
Source Control
The solution you have opened is under source control but not currently configured for integrated source control in Visual Studio. Would you like to bind this solution to source control now?
Asking my colleague, I found out that he's been checking in the changes through Visual Studio without any problem.
Here's my question: Considering the fact that I can still check in my changes via IDE, what is the use of binding a Visual Studio solution or project to TFS (or more generally source control)? Except that "lock"/"red tick" icon appearing beside them in Solution Explorer.
Adding Solutions and Projects to Source Control: When you add a solution to source control, the solution becomes part of a dynamic versioning archive created and maintained by the source control provider. Each time someone checks in a new version of the solution, that version becomes part of the archive and is available to other source control users.
According to the warning message, It seems that you are opening from source control a solution that was incorrectly added to source control (it's missing some bindings strings that should have been in the sln or project files). You should click the button yes and Bind the projects correctly to their server location, then OK the dialog. The server file will be checked out and modified locally. You should checkin the changes after that.

TFS 2010: Project file gets deleted on Get Latest Version

We have a standard installation of TFS 2010 with a handful of developers. We do have a number of projects with a number of branches but nothing to crazy. Frequently we will go to get the latest version of a solution and TFS will delete the project file (csproj) of one of the projects, a MVC 3 web project. Looking at the Source Control logs we see the following error:
One or more source control bindings for this solution are not valid and are listed below.
Source control bindings can be modified by selecting File, Source Control, Change Source Control from the main menu.
If we go into the pending changes view and undo the deleting of the project file everything works fine. Does anyone know what the error message means and know what it is that we are doing that is causing it?
Environment:
TFS 2010
VS 2012
SQL Server 2008

TFS will not accept changes I've made to a Java project

I am using TFS's Team Explorer to manage Visual Studio projects.
Recently, I've created a new Java project (not in Visual Studio) which I manually added to TFS using the Source Control Control explorer in Visual Studio.
After I added the Java project to TFS, I made some changes and bug fixes. Then, I went into Visual Studio and opened the Source Control Explorer to check in my changes, but TFS thinks that no changes were made.
It seems that I needed to check out the project before making changes. I guess I erroneously expected TFS to track that automatically, but okay.
So, using the Source Control Explorer in TFS, I checked out the project, and then I tried to check in pending changes. When I tried to check in, I got the following message:
All of the changes were either unmodified files or locks.
The changes have been undone by the server.
Is there a way to convince the server that indeed my project has changed? How can I check in the changes that I have made?
Thank you for any help.

TFS SCC: How can I get new files listed in the Pending Changes Panel in Visual Studio

We are experimenting to use Microsoft Team Foundation Server Source Code Control as a replacement for SVN.
Therefore, it would be great if the friction for this transition would be minimal.
For example, in SVN, whenever I create new files in the folder, and then use "Tortoise SVN Check for Modifications", I get a master list of Added Files, Deleted Files, and Edited Files.
I know that in TFS SCC in Visual Studio, the equivalent is the Pending Changes Panel. However, this panel only lists Edited Files. How can I get new files listed in that panel, too, just like SVN does?
The workflow really depends on whether you are using Local Workspaces or the traditional Server Workspaces. As you are coming from SVN, Local Workspaces would probably be a good fit.
Local Workspaces (New to TFS 2012)
Local Workspaces are TFS's attempt at DVCS and actually gives you a much more SVN-Like experience. The pending changes window with local workspaces is divided up into the following areas:
Included Changes - This is effectively files that are already in Source Control that have been changed.
Excluded Changes - These are all files within the workspace that are not in source control. This is like your Added files in SVN.
Server Workspaces
Server Workspaces are the traditional TFS workspace approach. An item is not in Source Control until it is explicitly added.
There is a much more detailed article on the differences here: http://msdn.microsoft.com/en-gb/library/bb892960.aspx
Drag and drop your new files into the right folders in the Source Control Explorer in Visual studio and then there will be asked if there are also files that need to be excluded from the source control. If that is done they are in the Pending changes window. The implementation like SVN is starting from Visual studio 2012 but then still it can give issues and not be in that panel.
I see this is an old question but I believe the answer is in Visual Studio's "Pending Changes Panel" itself. Notice the "Excluded Changes (nnn)" section. Just below that heading you should find "Detected: nnn add(s)". You can see your 'new files' listed there.
For what it's worth, I find the "Pending Changes" an unwieldy feature in that it seems it's never context aware. I find that I often have to "weed through" many, many files that are simply not relevant to the solution/project(s) at hand.

Visual Studio project is loaded information

So I am working on a solution with a lot of projects with multiple developers using SVN. There are some projects that are specific for me that I want loaded but for others they might not be relevant.
So my question is, where does Visual Studio store information about a project begin loaded and what is the proper way to commit project/solution settings with out ruining it for others?
An example could be that I just added a new project to the solution and I want to commit these changes, but I don't want to commit whether or not a project is loaded/reloaded (Since other developers have to reload them again).
EDIT: I found the answer here When I unload projects in visual studio, where does VS save this setting?
When you add projects to a solution, they will get loaded when the solution opens.
If using source control, if such a solution is updated and contains new projects, they will get loaded.
One way of dealing with this is to create multiple solutions - solutions that only have relevant projects. These solutions can be part of source control, but don't have to, though if you don't add them to source control you risk having projects in source control that only you have a solution reference to.

Resources