Tuesday, April 25, 2006

"Resolve conflict hangs Visual Studio" issue

UPDATE Microsoft devs say that
* The issue occurs only rarely
* The problem usually may be localized to single file, so workaround suggested is sufficient
* Fix was already implemented to be distributed in first patch

So overall that downgrades the issue from "panic mode" to "something to be aware of".

See the full discussion on the issue.


ORIGINAL POST
Some of TFS users complained, that following scenario can get the application to hang:

1. Perform Merge between two branches
2. If there are conflicts, they are identified Conflicts dialog is displayed
3. Clicking Resolve brings up Resolving Conflicts dialog, saying that summary is built.
At this point application never comes back. And whats more, it happens for some files at some conditions (not exactly identified).

Saturday, April 22, 2006

How to determine source controlled solution workspace in Visual Studio

When you have several solutions in different workspaces, it is not always easy to remember what workspace you work with (say, you load the solution into Visual Studio from file system), but right workspace you need to specify when performing operations such as branch, that are not supported from the Visual Studio Solution Explorer, but rather from the TFS Source Control Explorer.

The answer is short - when you load the solution and open the Pending Changes window, the workspace selected by default is the one the solution is associated with.

When you change the workspace though, your selection will be remembered until solution is reloaded.

Thanks to Richard Berg for the answer.

Thursday, April 20, 2006

Opening local solution of other user

The following scenario may occur on shared computer:

1. Bob logs in using his account to computer A
2. Bob performs get latest to folder for the solution in his workspace
3. Bob performs required activities with the files in his workspace, finishes up his activities and logs off
4. Alice logs in using her account to computer A
5. Alice opens solution in folder using "Open..." Visual Studio menu
6. Error that "bingings are improper..." is displayed

The scenario is supported by Visual SourceSafe and is not possible with TFS (see error in bullet 6).
What user (Alice) should do in TFS is to perform "Open from Source Control" for solution in her workspace2 to folder2.

Additional point you should be aware of that message saying bindings are incorrect may be caused by the scenario above.

See issue discussion here.

Tuesday, April 18, 2006

View deleted files the Source Control Explorer

The Vertigo blog describes very useful feature I was looking for for ages.

If you want to Undelete deleted files in GUI, you may set Source Control Explorer to display deleted files.

The option may be set using menu Tools->Options->Source Control->Visual Studio Team Foundation, by checking magical "Show deleted items in the Source Control Explorer" checkbox.

Every TFS practioner must-know-how-to!

Undo add of solution/project

If you have performed addition of unbound solution/project to TFS source control, and want to undo the operation, there are several gotchas.

First, you perform "Undo pending changes" to undo pending Add change. All is kool, the operation is undone and it is possible to work without source control as before.

But let's say that you finally decided to add the solution/project. Several findings here:

* "Add to SC" functionality is not available! Ok, I have undone the operation but now I do want to add my solution!
Workaround: must go to File->Source control->Change source control, and there one will discover that there still exists binding of the solution to TFS. Unbind the solution/project, and then "Add to SC" functionality becomes available

* Now when performing the Add, TFS does not ask you for mappings. It adds your files to the path you specified before Undo operation!
Workaround: must go to your workspace, and there one will discover that there is mapping for your solution. Remove that mapping - then on Add TFS will ask you to specify the path.

Overall, I would say those are the facts to be aware of (as Microsoft says here there are aware of those somewhat unobvious workarounds, so any TFS user also should)

Conflict resolution window

It has been stated in Chris Rathjen blog that conflict resolution window may be displayed in three different cases.

Must check that thoroughly! Have seen those empty windows now and then, never quite knowing why...

Monday, April 17, 2006

How lock set on file is affected by check out

When check out operation is performed on file, the lock set will be that of the check out option specified. It may lead to some not entirely obvious consequences.

Obvious example
1) No lock on file prior to check out
2) After check out is performed with lock option other than "None"("Check-out" or "Check-in" lock), the file is editable and has changes "Lock,Edit" associated with it (in "View Pending Changes" window)

Not so obvious example
1) Lock on file prior to check out ("Check-out" or "Check-in" lock)
2) After check out is performed with "None" lock option, the file is editable and has change "Edit" (in "View Pending Changes" window)
That is, previously set lock level was essentially removed (demoted) by using check-out option.

So lock level may be either promoted or demoted by check out operation (the situation occurs only in case lock is owned by user performing check out or user has admin permissions for locks). Personally I think that is the thing to watch for or at least to be aware of.

As Microsoft explained in their answer, locks are affected only by explicit check outs; implicit check outs (for example, when auto check out on edit is enabled) are not affected.

Monday, April 03, 2006

How to create and add to SC solution with controlled projects

The idea is to have several Visual Studio solutions under source control - one solution containing all projects for release purposes and smaller modular solutions for development of different modules.

I have proceeded to achieve the goal as following:

1. Created new solution and added to it several projects
2. Added the solution with all projects to SC (using "Add solution to SC" menu)
3. Closed the solution
4. Created new empty workspace
5. Created new blank solution
6. Added existing source-controlled project to the solution using "Add project from SC" menu; mapped project path to be subfolder of the solution folder. At that stage I have modular solution with single project and I would like to add that solution to SC - and the things started going wrong
7. Tried to add solution to SC using "Add solution to SC" menu. Solution is not added and error messages are displayed to the effect that there are no pending check ins on solution files.

As was explained in the following discussion, to avoid these errors and reach the goal, the scenario must be somewhat revised. So instead do the following:

4. Create a new empty workspace, don't add any mappings.
5. Create a new blank solution and check the "Add solution to Source Control" box. It will prompt you for a location in SC to store the solution. If you created the new solution in an unmapped folder, there will also be a dropdown to select the workspace.
6. Bring up the "Add project from SC" dialog. After you choose the project (and location on disk if necessary), it should appear in Solution Explorer as already bound (with padlock as status indication).
7. Checkin the solution. Since the project is already bound, you only have to checkin the two solution files.