Quickest way to check what project is loaded in VS2013 - tfs

I have a solution that exists in multiple branches and multiple workspaces in TFS. When editing them in Visual Studio, they all look very similar. It is not uncommon for me to have multiple versions of the solution open at the same time in separate instances of Visual Studio. Three or four is not uncommon when tracing changes between branches. It can get confusing to know which solution is which.
What is the quickest way to tell which specific solution (file path or branch and workspace) I have loaded in VS2013?
My current approach is to open a file and hover over its tab to see the file location, but when I am Alt-tabbing through multiple instances of VS, this is tedious.

Related

TFS merge creates duplicate entries in Solution (project files)

We are using TF Service. As per best practices, we perform frequent merges.
The merge tool does a bad job handling merges for our project files. We get duplicates for Views, Controllers, even our PublishProfiles Folder.
I have a hard time believing that TFS hasn't been optimized to deal with something as trivial as dupes. The logic within our controllers, EDMX files, and Views should be more complex to merge, yet are handled better.
Are we doing something wrong? More specifically, is there an option or setting for TFS that better deals with such issues.
This is a known issue with the not so good Merge tool that accompanies Visual Studio 2010 and this Visual Studio 2012 has a completely renewed merge tool that can do contextual merges between XML files, which greatly reduces the chance of these types of issues cropping up. Since you're seeing this in Visual Studio 2012, I'd love to see a couple of examples that go wrong. I haven't had major issues since upgrading to Visual Studio 2012.
As a best practice, I tend to always do a Get-Latest before adding new files. And I always check in as soon as possible after getting the solution to compile again. This reduces the chances of these issues when you're working on the same branch. You might still end up with these types of issues when doing a merge between two branches though.
Additionally, instead of using the Visual Studio 2012 merge tool for all file types, you can set a custom merge tool for specific file extensions, that way you can use any commercial or open source merge tool instead of the default one. There's quite a few great examples out there:
WinMerge
BeyondCompare
TortoiseMerge
P4Merge
KDiff
Etc, etc, etc...
Your mileage may vary between the different tools out there.
In a team of only 3 developers this issue affects us badly with VS2013 and TFS2013. The best recourse I could find was to disable automatic conflict resolution in the settings menu.
http://donovanbrown.com/post/I-dont-trust-2012-Auto-merge-but-it-does-it-automatically-.aspx

Using TFS to manage mockups, other images?

I have a TFS server and I often work from two places. I'd like to have a folder that I just keep my random PSDs, mockups, etc in. Maybe even text file notes, or whatever.
The problem is, when I "Check in" a project, it only includes files that are included in the solution. Is there a simple way to have a folder always included?
For instance right now I just have a "mockups" folder in the root of my Team Project (above any individual project folders), but it's not part of any project or solution (I don't really want to publish a few megs of PSD files every time I publish my project).
You can create a Solution folder in your Solution and add the files as an existing file.
(or what is a solution folder)
Do have the psd and mockups something to do with your code?
If not I wouldn't recommend to add the files to the solution.
I would use the Windows Explorer AddIn from TFS Power Tools.
With it you have the ability to checkin/add/checkout files without Visual Studio, you only need to map a folder to your source control.
You can choose on the pending changes window whether you want to have all files checked in from your workspace or from your solution.
See How to show pending changes only for the currently opened solution in Visual Studio 2010 (TFS) and not the complete list of all changes? for a screenshot.

TFS - What happens if I delete a workspace?

I started work a lone developer last year and I found VSS is no longer a good option for source control so I decided to use TFS 2010 instead.
I have had to learn everything from a book - of which there are few.
I am currently creating a new build and in my workspaces I see a have 4. I want to delete one of them and rename another.
However I do not know what the consequences of doing this are. If I delete a workspace, will that remove the associated files under source control? How do I check which files these are? What happens if I change a status from active to cloaked?
As you can see, I am a beginner in all this.
Workspaces are only a mapping from SourceSontrol folders onto your local file system. Also workspace contains information about versions of the files you have locally, so when you hit 'Get Latest Version' only recent changes are sent from server to you, not the whole files. Information on what files are checked out is stored in workspace too, so if you have pending changes in the workspace and delete it then there'll be a bit of a challenge to check these changes in. Renaming of the workspace will not break anything as far as I know.
Article An introduction to TFS Workspaces may be interesting to you.
Like the others have said, the workspace only says what local files you have checked out, and the status, etc. Workspaces are pretty granulal (i.e. per user and per machine) so you could have mutliple workspaces with the same username in the same project. E.g. if you have a copy of Visual Studio at work and one at home, you could have different files checked out and you wouldn't run into any conflicts like you would have in VSS or something based on VSS Like like VSSConnect.
We've had a couple of people leave out project and have had to go in and remove their workspaces after the fact. This hasn't been a big deal in terms of any code losses but if you don't have access to the machine anymore you will have to use the TFS tools.
Try TFS Sidekicks, it provides a nice GUI to manage all the nitty-gritty back-end stuff in TFS

Can I branch a file to another TFS workspace?

I have some general purpose classes in one project that I would like to branch to another unrelated project in another TFS folder that I have mapped to a different workspace. I would prefer branching to plain copying to keep the change history and be able to merge back any changes.
However, when I try to branch the file in TFS, it complains that no appropriate mapping exists. Is there a way to branch across workspaces?
It turned out that I just had to select my source control explorer workspace to be the target workspace rather than the source workspace, then branching was allowed.
Now the files appear in the other project with history and possibility to merge back.
No, that's not possible - at least not that way.
But if you have general-purpose libraries, which are used across various applications, you should reorganize your project and workspace structure anyway...
If you had for example two solutions, which partially include the same project(s), and then would map each of these solutions to an individual workspace, then it should work.
HTH.
Thomas

TFS out of sync between local and remote - how to "re-sync"?

I have a Project on CodePlex which is using TFS and I am using the TFS Plugin for Visual Studio. Now I have copied this project and worked on another PC without TFS and done some refactoring. Foolishly, I have then just used copy/paste and manual text editing to merge my changes, expecting that TFS just picks up the changes.
Apparantly, that is not the case.
Here is a screenshot of my local directory:
My Local TFS http://img259.imageshack.us/img259/2897/tfslocal.jpg
Notice how some files are missing the lock symbol - those are missing. If you look at the current TFS Tree on Codeplex, there are some files which do not exist locally anymore, i.e. WikiPlexExtensions.cs in the main folder.
Is there any way to easily tell TFS to compare my local to the remote repository and pick up the changes? I could re-add the local files using "Exclude from local project" and re-adding them, and I could create the "deleted" files as empty files just to delete them, but if I can avoid the manual messing around that would be good as well :)
The easiest way is to exploit VS 2008's "online" feature. Basically you want to set your solution offline, then bring it online while connected to the proper Codeplex server. TFS should figure out the rest.
Feature overview: http://msdn.microsoft.com/en-us/teamsystem/bb898913.aspx
Tweaking the settings by hand: http://blogs.msdn.com/benryan/archive/2008/07/09/using-tfs-2008-power-tools-to-modify-server-s-offline-state.aspx
To compare local and server folders, you can check out TFS Power Tool. After installing it, you can bring up the source control explorer, right click on the server folder and then select 'Compare'. Folder difference window will display the differences. You can also right click on the differences to see available commands such as 'Get Latest' to update your local folder for example. Check out Bryan Harry's blog post on the power tool
I don't think there is an easy fix... What I've done in the past is back up those files that I have edited, then do a "Get Latest Version..." for the files I edited. This should change the files back to being read-only etc... Now, check out the files the regular way and paste the backups you had into the checked out files. Obviously this really only works when there are a couple of files you have edited.
TFS (in Visual Studio) has a "Reconcile" command for this, see Microsoft documentation, or this answer with steps.
BTW: This command may not haven been existing at time of original question, but this question came first when I was searching.

Resources