Mindmajix

TFS Interview Questions

TFS Interview Questions

Q. Mention what is team foundation server?

Team foundation server is used for inter-communication between the tester, developer team, project manager and CEO while working on software development.


Q. List out the functionalities provided by team foundation server?

  • Project Management
  • Tracking work items
  • Version Control
  • Test case management
  • Build Automation
  • Reporting
  • Virtual Lab Management

Q. Explain TFS in respect to GIT?

TFS:

  • Team foundation server is a Microsoft Version. It supports about 5 million lines of code
  • TFS integrates with Visual Studio, SharePoint and Active directory
  • TFS is more secure as you can assign read and write permission to an individual file
  • TFS requires SQL server to store all kind of data’s
  • TFS is centralized where the vast majority of the information is stored on the server
  • TFS does not support safe merge between unrelated branches
  • In TFS, you can do manual test tracking
  • Installation will take about ½ day
  • Analytics reports and chart option is given

GIT:

  • Git is open source, and designed to support the source code of Linux Kernel and supports about 15 million lines of code. Development process is distributed all around the world.
  • Git does not support any of these
  • Git is less secure as the whole git repositories is regulated by file system
  • Git is based on Distributed Version Control System (DVCS) that means every developer’s copy can access every version of every file from anywhere
  • Git keeps every local copy fully independent
  • Git allows safe merge between unrelated branches
  • In Git, you cannot do manual test tracking
  • Installation will only take 10 minutes
  • Analytics reports and chart is not represented

Q. Explain how you can create a Git-TFS in Visual Studio 2013 express?

To create a Git-TFS in Visual Studio 2013 express

  • Create an account with MS TFS service if you don’t have inhouse TFS server
  • After that, you will be directed to TFS page, where you will see tow option for creating project, one with new team project and another with a new team project+Git
  • The account URL will be found right below “Getting Started.”
  • Click on create git project and it will take you to a new window, where you specify details about the project like project name, description, the process template, version control, etc. and once completed click on create project.
  • Now you can create a local project in team foundation server by creating a new project in Visual studio and do not forget to mark the check box that says “Add to source control”
  • In the next window, select mark Git as your version control and click ok, and you will be able to see the alteration made in the source code
  • After that, commit your code, right click a file in team explorer and you can compare version differences

Q. Mention whether all of the team foundation service features are included into the Team foundation server?

TFS service is updated every 3 weeks while Team Foundation Server “on-premise” is updated every 3 months.  So, the on-premise version will always remain a little behind. However, TFS on-premise has got something that the TFS service does not.

  • You can use TFS Lab
  • Customize work items/process templates

Q. Explain what kind or report server you can add in TFS?

TFS uses SQL for its data storage, so you have to add SQL server reporting services to provide a report server for TFS.


Q. How one would know whether the report is updated in TFS?

For each report, there will be an option “Date Last Updated” in the lower light corner, when you click or select that option, it will give details about when it was last updated.


Q. Explain how you can restore hidden debugger commands in Visual Studio 2013?

To restore the debugger feature that is hidden, you have to add the command back to the command

  • Open your project, click on Tools menu and then click customize
  • Tap the command tab in the customize dialog box
  • In the menu bar, drop down, choose the debug menu for which you want to contain the restored command
  • Tap on the Add command button
  • In the Add command box, choose the command you want to add and click OK
  • Repeat the step to add another command

Q. Explain how you can track your code by customizing the scroll bar in Visual Studio 2013?

To show the annotations on the scroll bar

  • You can customize the scroll bar to display code changes, breakpoints, bookmarks and errors
  • Open the scroll bar options page
  • Choose the option “show annotations over vertical scroll bar”, and then choose the annotations you want to see
  • You can replace anything in the code that frequently appears in the file which is not meant to be

Q. Setting up Team foundation server

I have to setup team foundation server for a company, something that I don’t have any experience in.

The company will have about 5 or so developers that will be using it.

Is this a big task or something that is fairly easy to do (with instructions)?
Any helpful tutorials that you can recommend?

Any recommendations on server specs for a team of 5-10?

A: Disregard the “Cliff’s Note” link – it’s for VSTS 2005. There’s no reason to install an old version – the installer (and everything else about the product) is MUCH improved with VSTS2008. Also make sure you install SP1 – it’s not just bug fixes but some MAJOR enhancements.

Instructions for install are here: Team Foundation VSTS2008 Install Guide make sure you closely follow the recommendations for the Accounts necessary for install.

Blog post with recommendations for server specs

The link that Espo posted is excellent walkthroughs for configuring TFS after you get it installed.

TFS 2008 SP1 Download

Also you will want the following

TFS 2008 Power Tools in particular there is a “Team Foundation Server Best Practices Analyzer” which you can run against the server before the install to make sure everything is patched correctly etc (and afterwards to make sure the install went properly). It will require Windows Powershell installed on the server as pre-req.

Also you will want Team System Web Access 2008 SP1 – (formerly Team Plain) which will allow you to access the features of TFS as a web application.


Q. Is there a way to link work items across projects in TFS

In Team Foundation Server is there a way to have work items in one project linked to other projects so they show up in the reports in both. We are thinking about keeping release engineering items in their own project and want them linked to the project they are actaully for as well. Is this possible? So for instance I would create the item under release engineering assign it to an engineer and then link it to Product X so it showed up as a work item for Project X as well.

A: This is possible in TFS 2010 at least: link tfs work item to different project

Not sure on the effects on reporting though.


Q. How can I see all items checked out by other users in TFS?

I want a list of all the checked out files, by all users, in a project in TFS 2005. All I can see now aremy checked out files – in the pending changes window. I remember that in Source Safe there was such an option – is there one in TFS 2005?

A: The October 2008 edition of the TFS Power Tools includes “Team Members” functionality that allows you to do this, and more.

There is more information on this feature on Brian Harry’s blog.

tf status itemspec /user:* /recursive

in the VS Command Prompt. itemspec is the TFS path to the item you want to search for checkouts. No extra installations needed


Q. TFS: Moving from one server to another

How do I move my code and change history from one TFS server to another?

A: Use this: TFS to TFS Migration Tool from CodePlex


Q. What to do with a branch after the merge with TFS

After merging a branch back to the “trunk” what do most people do with the branch. Just delete it? Move it to another area? Change it’s permissions?

The concern we have is that developers who are away, and don’t read their mail could come to work and continue working on the branch, after the merge has been done.

A: Once the branch is definitely dead then I like to delete them. You can always undelete something in TFS if necessary (Options, Source Control, Show Deleted Items). Dev’s working in that area without realizing it may get some strange behaviour (i.e. files dissapearing when they do a Get Latest) however it get’s them to figure out something has happened pretty quickly.

That said, sometimes it can take a while to ensure that the branch is definitely deceased in which case changing the permissions on the branch so that only a limited number of people can edit the files on that branch is a handy technique. You can have one person lock all the files in the branch with a check-out lock but I’ve not found that to work too well when freezing a branch – permissions seems to work better so that you do not have to have a bunch of pending changes (the locks) to manage for all the files in the branch and also you can have more than one person working on it while it is being frozen.


Q. How do i find and view a TFS changeset by comment text

with TFS I need to find a changeset by comment, and or by developer. Maybe I’m just blind today, but I don’t see a simple way in the Sorce Control Exploer to do this task?

A: With the Power Tools installed:

tf history $/ -r | ? { $_.comment -like *findme* }

EASY WAY and no 3rd party apps/add-ons needed:

  1. Open Source Control Explorer
  2. “View History” from the root of TFS server
  3. Scroll to the bottom (it’s fast with hitting “End” button continuously)
  4. Select all records, copy
  5. Open Excel and paste

Now the Excel will allow you to search through comments (Excel’s a native app, don’t argue..).


Q. TFS: Create a new project from an existing one in TFS

What is the best way to create a completely new project in TFS by copying an existing one?

I have an ASP.NET project that will have 50+ “releases” per year. Each release is a distinct entity that needs to remain independent of all others. Once created, I want to make sure that any change to one (the source project or the copy) does not affect the other.

This is for source control only. I do not need to copy any work items.

In the pre-TFS world I would do this by simply copying the folder that contained all of the project files. This had me 90% of the way to the new app, which I could then tailor for the new release. It is very rare that I need to actually add functionality to the base application, and even when I do it never affects existing apps. Is this still possible using TFS, by copying my local folders and then adding the copy into TFS as a new project?

Any suggestions? One branch per release looks like the “standard” way of doing this but I will quickly end up with dozens of branches that really aren’t related, and I’d rather keep each new project as it’s own distinct project, with no chance of changes in one affecting the other.

Thanks!

  • Thanks for the responses. I think you’ve all given me enough insight to get started. Richard, thanks for the detail. I was a bit concerned that it might be too easy to accidentally merge the branches.

A: I would recommend using branching. Create a branch for each release from the main branch. As long as you do not merge the branches they will remain independent. Changes to the main branch will only affect releases created after the those changes were made.

You could copy the files and create a new project, but you may run into a couple of problems:

  • The projects “remember” that they were in TFS, there is a bit of manual work to clean up special files etc.
  • TFS may slow down when you have many projects, compared with a single project with branches

Q. How can I exclude a specific files from TFS source control

We have mutiple config files (app.DEV.config, app.TEST.config, etc) and a pre-build event that copies the correct config file to app.config. Obviously the configuration specific files are in source control — but at the moment so is App.Config, and that shouldn’t be.

How can I mark that one file as excluded from source control, but obviously not from the project.

I’m using VS 2005, and 2005 Team Explorer.

A: There is a checkin policy in the MS Power Tools which lets you screen filenames against a regular expression. See: Microsoft Foundation Server Power Tools While checkin policies are not completely foolproof, they are the closest thing TFS has to enforcing user-defined rules like what you’re looking for.

If you just want to exclude a single file from Source Control, then select it in the Solution Explorer and choose “Exclude from Source Control” from the File>Source Control menu.

(And as the others have said, you can also cloak a file or folder, which means it stays in Source Control and is visible to everyone else on the team, but it’s not copied to your PC until you decide to uncloak it; or you can delete the file, which means it gets deleted from everybody’s PCs when they get latest – but neither of these options will prevent such files being added to source control in the first place)

It’s easy in TFS2012, create a .tfignore file

http://msdn.microsoft.com/en-us/library/tfs/ms245454%28v=vs.110%29.aspx#tfignore

Skip code block

######################################
# Ignore .cpp files in the ProjA sub-folder and all its subfolders
ProjA\*.cpp
#
# Ignore .txt files in this folder
\*.txt
#
# Ignore .xml files in this folder and all its sub-folders
*.xml
#
# Ignore all files in the Temp sub-folder
\Temp
#
# Do not ignore .dll files in this folder nor in any of its sub-folders
!*.dll


Q. TFS Work Item Query against TFS Groups

Does anybody know how to create a work item query in TFS that will query users against a TFS group? (ie, AssignedTo = [project]\Contributors)

A: In visual studio 2008, there is an ‘In Group’ operator in the query editor. You can use it and specify any TFS group.

If that doesn’t work, try this. This is a fairly convoluted way to get the query working, but will work, involves using the group security identifier (SID) to bound the query.

SELECT [System.Id], [System.Title]
FROM WorkItems
WHERE [System.TeamProject] = @project
AND [System.AssignedTo] IN GROUP
‘S-1-9-1551374245-1204400969-2402986413-2179408616-1-3207752628-1878591311-2685660887-
2074056714′
ORDER BY [System.Id]

To find the SID of the specific group your interested in, run the tfssecurity.exe utility as Run as Administrator with the /i Contributors and server parameter //server:MyTFSServer. This will return something like the following.

Resolving identity “Contributors”…

SID: S-1-9-1551374245-1204400969-2402986413-2179408616-1-3207752628-1878591311-2685660887- 2074056714

DN:

Identity type: Team Foundation Server application group Group type: Contributors Project scope: Server scope Display name: Contributors Description: Members of this application group can perform all privileged operations on the server.

Its long winded, but once you know the SID, and build the WIQ query, and save it, that will be it.


Q. Edit other users’ alerts for a project in TFS

I am unexpectedly taking over for the previous administrator of our TFS system who left the company rather abruptly. I was made an admin of TFS and on the TFS application server before this happened, but there is still at least one thing I can’t figure out. It seems there are some alerts set up under the previous administrator’s account that sends email to all of us whenever a file is checked in. I can’t say for sure exactly what this subscription looks like, but I’m guessing it’s either in the “Project Alerts” dialog for the project, or it’s an alert set up with TFS Power Tools’ Alert Editor. I can’t see alerts set up by other users in these areas. Is there any way short of directly editing the tbl_subscription table directly to try removing or changing these alerts? (I think I see the alert in that SQL table, but I don’t want to directly hack the database.)

A: I’m really glad to say that in the next version of TFS and in the current version of the Azure-hosted version of TFS, administrators can manage other user’s alerts using Team Web Access. Thankfully, this should be a scenario of frustration in the past.

I have some more information available on a blog post written for this topic here:http://www.edsquared.com/2012/02/09/Creating+EMail+Alerts+For+Team+Members+In+TFS.aspx

Screenshot_1


Q. TFS Get Specific Version into separate folder

I’m currently working on a project with TFS source control. We’ve just gotten in a bug report for an older version of the code, and I need to pull down that version of code to test it out. My first thought would be to “Get Specific Version” to pull down the code, but I’d rather not get that version into my current workspace directory.

Is there an easy way to “Get Specific Version” into a separate (e.g. temporary/throw-away folder), so I can quickly look into this bug in the older version of code, and not disturb my current work?

A: I just found one easy way to do this: Create a new Workspace in TFS pointing to a separate folder, then switchover to this new workspace and do a Get Specific Version here.


Q. How to browse and view files stored in a Team Foundation Server without using Visual Studio

I’m looking for a tool to browse and view files stored within a Team Foundation Server without using Visual Studio. As I’m doing most development on a virtual machine, it’s very annoying to wake it up only to have a look on a certain file.

So is there a way to browse a TFS without Visual Studio?

A: The TFS Power Tools now have Windows Shell Extensions, so you manipulate source control files using only Windows explorer. Your solution could be to just keep a working copy of the solution and then you do whatever manipulations you need to using Windows Explorer.

http://www.microsoft.com/downloads/details.aspx?FamilyId=FBD14EEA-781F-45A1-8C46-9F6BA2F68BF0&displaylang=en


Q. How to find all changes below a certain point in the TFS source control tree

I need to know what changes (if any) have happened at a particular level in our source control tree. Is there some way to make such a query of TFS?

A: Using Team Explorer:

  1. Open Source Control Explorer
  2. Navigate to desired source control folder
  3. Right-click and choose View History

Shows you all of the changesets that have been checked in at that level in the tree or below.

Using the tf utility:

tf history c:\localFolder -r -format:detailed

Here’s a link to the tf history documentation for more details on usage: link

Using the TFS SDK to do it programatically:

Here’s a sample method based on some of our code. It takes a path, start time and end time and gives you all of the changeset details below that path in between the two specified times:

Skip code block

private StringBuilder GetTfsModifications(string tfsPath, DateTime startTime, DateTime endTime)
{
StringBuilder bodyContent = new StringBuilder();

TeamFoundationServer tfs = new TeamFoundationServer(“YourServerNameHere”);
VersionControlServer vcs = (VersionControlServer)tfs.GetService(typeof(VersionControlServer));

// Get collection of changesets below the given path
System.Collections.IEnumerable changesets = vcs.QueryHistory(
tfsPath,
VersionSpec.Latest,
0,
RecursionType.Full,
null,
new DateVersionSpec(startTime),
new DateVersionSpec(endTime),
int.MaxValue,
true,
false);

// Iterate through changesets and extract any data you want from them
foreach (Changeset changeset in changesets)
{
StringBuilder changes = new StringBuilder();
StringBuilder assocWorkItems = new StringBuilder();

// Create a list of the associated work items for the ChangeSet
foreach (WorkItem assocWorkItem in changeset.WorkItems)
{
assocWorkItems.Append(assocWorkItem.Id.ToString());
}

// Get details from each of the changes in the changeset
foreach (Change change in changeset.Changes)
{
changes.AppendLine(string.Format(CultureInfo.InvariantCulture, “\t{0}\t{1}”,
PendingChange.GetLocalizedStringForChangeType(change.ChangeType),
change.Item.ServerItem));
}

// Get some details from the changeset and append the individual change details below it
if (changes.Length > 0)
{
bodyContent.AppendLine(string.Format(CultureInfo.InvariantCulture, “{0}\t{1}\t{2}\t{3}\t{4}”,
changeset.ChangesetId,
changeset.Committer.Substring(changeset.Committer.IndexOf(‘\\’) + 1),
changeset.CreationDate,
changeset.Comment,
assocWorkItems.ToString()));
bodyContent.Append(changes.ToString());
}
}

return bodyContent;
}


Q. Unified Diff in TFS

Anyone know if this (generating a unified diff) is possible and if so, how?

A: This is what I usually do:

  • Generate a unified diff from tf command line to get a patch file

tf diff /recursive /format:unified .  >> diff.patch

patch.exe -p0 < diff.patch

Obviously this assumes that the source files are already checked out. If they are not, especially when you are applying patches across branches, write a simple shell script to go through the diff file, get the files path and tf edit them.


Q. TFS: Overwrite a branch with another

Is it possible overwrite a branch with another?

Or is the only solution to delete branch B and make a new branch from Branch A?

A: Unless you’re running TFS 2010, I’d recommend using Merge + Resolve to bring the two branches back in sync.

tf merge A B -r -force -version:1~T
tf resolve B -r -auto:acceptTheirs

That should equalize everything, except for files that were only created in B and never merged back. Use Folder Diff to find & reconcile them.

Delete + rebranch in 2005/2008 runs the risk of nightmarish-to-debug namespace conflicts in the future. The other option, if you have 2008, is to Destroy + rebranch. Obviously that assumes you are ok with losing all the history from the original copy of B.


Q. How to browse TFS changesets?

I want to browse TFS changesets.

I do NOT want to search changesets by specifying a file contained within the changeset. I do not want to specify which user I think created the changeset.

I simply want to key in a changeset number and look at that changeset. Or maybe view a range, and then browse those.

No specified file, no specified user. TFS 2008 seems to not want to allow me to do this.

I must be missing something.

How do you do this?

A: In Source Control Explorer, hit CTRL+G. This will bring up the Find Changesets dialog. Unfortunately it’s kind of one-size-fits-all in VS 2008: you have to work inside a big bulky search dialog, even if you already know the number(s). In your case, flip the radio button to search by range and then key in the desired changeset number as both the start & end of the range.

The VS 2010 version of this dialog simplifies the “lookup single changeset by #” use case, FWIW.

My personal preference: if you have a console window open, there’s a quicker route. Simply type tf changeset 12345. If using the Power Tools, you can substitute “Get-TfsChangeset” or “tfchangeset” for improved performance and programmability.


Q. Team Foundation Server How to Edit file without checking it out

i’m working with TFS and i need to edit file localy without checking it out . another case if some one checked in the file and i need to change my locally copy.

what should I do ? in Visual source safe we can do that by removing the read only check on the file.

A: Ok, this is relatively easy in VS2010, and quite normal. I mean the locking model of source control is obsolete anyway.

In vs2010, click Tools -> Options -> Source Control -> Environment and select Allow checked-in items to be edited. This should stop the TF client from marking files as read-only.

Also you may have to change the Editing drop-down in Source Control -> Environment to Do nothing.


Q. How do i remove files from the Pending Changes list in TFS when those files have been deleted locally

as the question says…anyone now how I can remove these files. I didn’t commit the changes in TFS before I deleted them locally and now they always appear in the Pending Changes window…I’d like to get rid of them

thanks

A: Right-click on the file in the Pending Changes list, choose Undo.

Brian

Solved

I recreated the deleted forlder directory and files in TFS and checked them in. Then I deleted them and they were gone from the Pending changes window.


Q. How to add an image to a TFS work item; as an image, not as an attachment

Our team is in the process of begining a project which is being managed using TFS. Several requiremens which existed only in Word documents are being migrated to TFS work items. The Word documents contain various diagrams and images which we need included in the work item, specifically under the ‘Details’ and ‘Analysis’ tabs. The problem is that images cannot be pasted into these tabs as images.

The only option to add images to the work item appears to be as an attachment.

Could someone confirm this?

Any assistance is appreciated.

A: You can change the text boxes to accept HTML, but that may still require the image to be hosted elsewhere.

HowTo: http://msmvps.com/blogs/vstsblog/archive/2009/01/11/using-rich-html-descriptions-instead-of-plain-text.aspx

It may also be best to just link to the existing document. We have to do this for now, because we have a large repository of existing documentation that no-one wants to bother converting.


Q. How to unlock a file from someone else in Team Foundation Server

We have a project that is stored within our TFS server and some files were Checked-Out by me from another computer and another user (both of which are not used anymore). Is there a way to force the unlocking of the file (no changes were made to it so it’s safe to do so if I can only do it).

A: You can use the Status Sidekick of TFS Sidekicks tool and unlock the files which are checked out by other users. To do this you should be a part of Administrator group of that particular Team Project (or) your group should have the permissions to undo and unlock the other user changes which by default Administrator group has.

You can get the tool here: http://www.attrice.info/cm/tfs/


Q. How can I get all my checkins in Visual Studio 2010 TFS?

On Many occasions I need to review my checkins . Is there a way I can get all my checkins in TFS? I dont mean view history on a particular file,but all my checkins! If I can filter based on start and end date would be great

A:

  1. Open “Team Explorer” (Found in “View”-menu)
  2. Find the team-project and expand “Team Members”
  3. Right-click the team member and select “Show Checkin History”.

But it is very strange that one cannot do this filtering directly, when viewing the entire history of a team-project.

Yet another alternative is to use the “Link to”-search within TFS WorkItem:

  1. Open a TFS Workitem
  2. Choose the “All Links”-tab
  3. Press the “Link To”-button
  4. In the new dialog set “Link Type” to “Changeset” and press “Browse…”-button.
  5. Now you have a TFS search dialog, where one can specify username and other filtering

See also VS2010 – Find Information About a Changeset


Q. What permissions are needed to add/edit work items in TFS

I would like to grant my Q/A team permissions to create an edit bugs in TFS. I could just throw them into the Contributors group, but I would rather create a Q/A group and assign it permissions specific to creating work items. What permissions do I need to grant them. (TFS 2008)

A: It’s actually going to be found under Area security. Within VS 2008:

  • In Team Explorer, click on the appropriate team project that you want to check/change
  • Choose theTeam–>Team Project Settings–>Areas and Iterations
  • choose the appropriate area. If you don’t have any defined, or you want it to apply to all of them, choose the “Area” node.
  • Click on the.. button.
  • The permissions to edit work items is set here:Edit work items in this node

Q. How to use the blame feature in TFS?

How do you use the blame feature in TFS?

A: The TFS equivalent is the Annotate command I believe. (Simply right click on the versioned file in the source code explorer and select “Annotate”.)

There’s more information on this over on MSDN.


Q. Tips and tricks to increase productivity / efficiency with Team Foundation Server

I have to use Team Foundation Server 2010 at my company and I’m not very happy with it. There are so many features or just default behavior I’d expect from a CVS that TFS seems to lack (compared to svn, git or perforce, which I have experience with), so my question is: which tricks do you know, which hidden features are out there to make TFS easier to use / more convenient?

Perhaps I should elaborate a bit and list what I think could be better:

  • The default check-in action when associated with a task is “resolve”, though in 99% of all check-ins, I only want to “associate” my commit with the task. There’s only 1 commit (the last) that “resolves” the task, so why is that the default? Can I change that?
  • In the check-in dialog, when double-clicking a file, Notepad is launched and shows the contents of the file. Notepad. Seriously? What about the Visual Studio editor? Anyway, I’d like to see the differences to review the changes I’ve made, not the contents of the file. The diff tool is hidden in a submenu. This might seem trivial, but when I have to check 10+ files it’s just annoying to always right-click, open submenu, click to diff.
  • The diff tool. Merging with it isn’t really straightforward, also the conflict detection mechanism is somewhat lacking. The (Tortoise-)SVN / Git merge tools or that of Perforce are way better here.
  • Creating a new file, opening a file for the first time, comparing a file with a previous version etc takes forever (that is, 3-10+ seconds). Our TFS server is in-house and has absolutely no load – also why does Visual Studio have to contact the TFS server when I just create a new file (which I might not even check in)? Is there perhaps an option to turn that off?
  • Readonly files. All files are read-only when checked-in and become writeable when edited for the first time. This is really annyoing when the application crashes because of that. Windows Azure for example modifies a web.config file and fails whenever I check out because the file is read-only then.

These are just the most prominent things that I think are really annoying and unnecessary. I didn’t have the pleasure to branch and merge yet, but from what I’ve heard so far it won’t be very enjoyable as well…

So again: If you know some tricks, settings, featuers that make working with TFS less inconvenient, please share them.

A:

1) is customizable if you reconfigure the work items. (You can also change any combination of fields/states/available values/etc.)

2) is a pain, but if you use the dockable “Pending Changes” window instead then it’ll open the file in the editor. I suspect this is a drawback of the Checkin dialogue being modal.

3) you can customize – the option’s a little tucked away, but it’s on Tools/Options dialogue under Source Control/Visual Studio Team Foundation Server/Configure User Tools. Some third party tools (like BeyondCompare) have pages on their website with details of how to configure them with VS.

4) I’ve not seen the speed problems, although I do agree about the overhead on creating a file. Not sure if that’s configurable.


Q. Team Foundation Server: How to view changeset history

I’d like to know how to view entire changeset history in Team Foundation Server for a given project.

this is what I want to see- starting from changeset 1 all the way to the current changeset:

show me change #, username, date of submission, description, files that were changed, etc.

note: i don’t want to just see the history for a given file, or dir, i want to see the history for the whole darn thing. i.e., what happened in changeset 1, what happened in changeset 2, what happened in changeset 3, etc.

A: You can go to the Source Control Explorer in Visual Studio and right-click on your project and select View History. This will show you the list of all changesets made to that project, who made them, the date they were made and any comment added to those changesets. if you double-click on any particular changeset, you can see the files that were changed in that one changeset.

edited to add links.


Q. Why does tfs prompt me to overwrite every file?

A: To work under TFS source control, you will need the following:

  • Your solution must be in source control!
  • Your source control provider must be set to TFS. Tools > Options > Source Control and make sure it’s the default SC provider.
  • You must have a workspace mapping on your local drive that tells TFS where the solution should be located on your hard drive. Open Source Control and there is a drop-down list at the top of the window that shows the currently selected workspace. Drop this combo-box down and it gives an option to edit the workspace, where you can tell TFS where specific folders in its hierarchy are to be located on your hard drive.
  • You need to bind the solution to source control to tell TFS that you want to work in a source controlled way on this solution. (From memory) go to File > Source Control > Change Source Control and usually just clicking the “Bind” button is enough.
  • You may need to synchronise your PC with the server. Open the source control window, right click on the parent folder of the solution, and do a “Get Specific Version”. Set this to “Latest” and tick the checkbox to get files that the source control system thinks you already have. This will synchronise your PC with the network so TFS knows what’s going on. (Note: The other checkbox will cause TFS to overwrite writable files, which could mean you lose any local changes you have made, so take a backup of your code first, and be careful about which options you enable)

I’ve been a bit brief, but if you find you need to do any of the above, I should have given you enough info that you can search the web for more specific help.


Q. How to Find TFS Changesets Not Linked to Work Items

Is there a way, either via a query or programmatically, to identify all TFS Changesets that are NOT linked to a Work Item?

A: Using the TFS PowerToy’s PowerShell module:

From whatever folder in your workspace you’re interested in:

Get-TfsItemHistory . -Recurse | Where-Object { $_.WorkItems.Length -eq 0 }

This will get the history for the current folder and all subfolders, and then filter for empty workitem lists.


Q. How to get the list of all “Change Sets” of a user in TFS?

I just want to get the list of all change sets of a user in TFS. I want only the id of the change set, and a link to all items which are being checked in as part of that change set.

How can I do that?

A: Besides option presented by Richard, you can also do that from within VS:

Screenshot_2

It’s also possible to do it via the API. I can provide a short snippet, if you’re interested.


Q. Get current changeset id on workspace for TFS

How do I figure out what changeset I currently have in my local workspace?

Sure, I can pick one file and view its history. However, if that file was not recently updated, its changeset is probably older than the more recently updated files in the same solution.

One possible mistake that we may make is that we view the history on the solution file, however the solution file rarely changes unless you’re adding a new project / making solution-level changes.

In the end to figure out the changeset I need to remember what were the latest files changed and view their history.

Is there a better way to do this?

A: Your answer is on a MSDN blog by Buck Hodges: How to determine the latest changeset in your workspace

from the root (top) of your workspace, in cmd perform:

tf history . /r /noprompt /stopafter:1 /version:W


Q. How to merge new files into another branch in TFS?

Ok, in TFS we have a main trunk branch and another branch, let’s call it secondary. We have created a new file in the trunk but when trying to merge that specific file, it does not give us the option to merge to the secondary branch. We’re assuming that it’s because an analagous file does not exist in secondary.

Is this the cause of the problem and if so, how can we get that new file from the trunk intosecondary?

Here, we are merging a file that does exist in secondary. As you can see, the dropdown lists all three of our branches (secondary is actually the middle one):

Screenshot_3

Now, when I try to merge a file which was created in trunk after secondary was branched,secondary is no longer listed as a target branch.

Screenshot_4

A: trying to merge that specific file

To understand TFS it helps to remember that the unit of change is the changeset, and it is changesets (not files) that are checked-in and merged.

We’re assuming that it’s because an analagous file does not exist in secondary

This is correct – at the version (changeset number) that the target branch is at, this file simply does not exist, so there is nothing to merge to.

In general, you don’t gain anything by selecting a particular file in the merge source dialog – as it says, it asks you to select the source and targe branches. Specify the branches at their root, chooseSelected changesets only, and TFS will show you a list of changesets that exist in source but have not been merged to target. If you only want the one that added this new file, you can select it in that list.


Q. TFS shortcut to compare a modified file with the latest version

Right now I have to pull up Pending Changes window, right-click on the file and select Compare->With Latest Version… Is there a faster way to look at my modifications?

A: Keyboard Shortcut for doing TFS Compare:

  • shift+ enter on file
    • will compare the files
  • shift+ double click on file
    • will compare file in background
  • Create visual studio mapping for the commands:

Set the shortcut for compare folder under Source Control Explorer, you should set the shortcut keys for File.TfsFolderDiff command.

Set the shortcut for compare specific file under Source Control Explorer, you should set the shortcut keys for File.TfsCompare command

Note: To set the keyboard shortcuts, open “Tools > Options”. In the dialog that opens, go to “Keyboard”. Example:

Note: The folder compare shortcut is only valid from the “Source Control Explorer”. It is the same as right clicking in the “Source Control Explorer” and selecting “Compare…”.

Screenshot_5

References:


Q. How to “order” tasks in TFS

I’m relatively new to TFS and I’ve been trying to figure out how to order tasks as follows.

Task 1

Task 2 (requires that Task 1 be completed first)

Task 3 (requires that Task 1 and Task 2 be completed first)

etc

Is there a way to do this? We are using TFS 2010.

A: Well.. I found it.

You can specify that a task is a “Predecessor” or a “Successor” to another task, or multiple tasks when you define the link between the two.

There is some basic info about it at this location: http://msdn.microsoft.com/en-us/gg465266


Q. TFS Shortcut to do a diff on all modified files with latest version

I’m looking for a way to kick off a diff on multiple files very easily.

I find it very tedious to have to:

  • Right click on every file
  • Click compare
  • Click with work space version.
  • Rinse and repeat for every file in my change set

Ideally, I’d like to be able to highlight all of the files in my change set, and perform one quick action that launched multiple windows of a diff tool, or launches them one after the other.

It’s it’s probably good to know that my question is very similar to this question but I’m looking for a way to do this in bulk.

A: Use the Tf Command Line Utility. It comes with Visual Studio. You’ll have a special command prompt with the tools loaded called “Visual Studio Command Prompt (2010)” in the Start Menu. You should cd to the root directory for the solution. This way you don’t have to provide the commands with a servername, credentials, or workspace information. It will pick it up automatically.

I ran the difference command. Without any parameters, it automatically shows the diff for every pending change.

D:\my-project> tf diff

As you close the diff window, the next change will pop up.


Q. TFS Merge And Keep The Associated Changesets/Comments

So let’s say I’m working in a development branch and I checked in a change, supplied a comment, and associated a work item. Now I want to merge that back to Main, is there a way I can have TFS merge know to associate that same work item and comment by default when I attempt to check it in?

Seems trivial but scale this out to multiple changesets a day and recording the work item numbers to reselect gets very tedious…

A: TFS has in my opinion a weakness on this one. All TFS-guides out there suggest that a multiple-branch scheme should be applied – which is absolutely reasonable (see here for a great reference).
Developers shall be working in ‘playground’ branches & once tests have succeeded, changesets are propagated into moree stable – more Release-near branches.

A somewhat duplicate question on that is this one.

According to the answers, an extension by J.Ehn could do what you ‘re after on the link-to-WI aspect. No evidence shows that the add-comments aspect is somehow included – yet this might not make tremendous sense (what should happen if the merge contains multiple commits from the \DEV-branch?). Still, it should be possible to fork this implementation and add the comments as well.

In the same question E.Blankenship provides with a rough road to another alternative.


Q. How can I always block checkin of a specific file in TFS

There is one file that I always made changes to, but that I never want to be checked in. I would like TFS to block me from ever checking it in or committing the changes. How can I configure TFS to do this?

Details: There is another developer on the project that has checked in some bad code that I prefer to comment out on my local machine. Since they are a client, I prefer to keep this a technical exercise rather than make it a political one.

A: Visual Studio 2013 (and 2012)

This feature is available by selecting the file(s) and going to:

File > Source Control > Advanced > Exclude … from Source Control


Q. Team Foundation Server – TF Get with changeset number

I’m trying to write a very lightweight “build” script which will basically just get a few files from TF (based on a Changeset number). Then I’ll run those files in SQLCMD.

I’m using this:

tf.exe get c:\tfs\  /version:c2681  /force /recursive

However, this appears to get EVERYTHING, not just the files in changeset #2681. I’d like to be able to point it to the root of my tfs workspace, give it a changeset number, and have it just update those few specific files. Also, it appears to be getting older versions (perhaps what was current when changeset #2681 was checked in)?

Is there a way to get just those specific files, WITHOUT needing to call them out specifically in the tf get itemspec?

EDIT: I actually had to add the /force option in order for it to do anything at all. Without force, it doesn’t appear to even retrieve from the server a file I deleted locally, that’s definitely in the changeset.

thanks, Sylvia

A: Everything mentioned in Jason’s and Richard’s posts above is correct but I would like to add one thing that may help you. The TFS team ships a set of useful tools separate from VS known as the “Team Foundation Power Tools”. One of the Power Tools is an additional command line utility known as tfpt.exe. tfpt.exe contains a “getcs” command which is equivalent to “get changeset” which seems to be exactly what you are looking for.

If you have VS 2010, then you can download the tools here. If you have an older version, a bing :) search should help you find the correct version of the tools. If you want to read more about the getcs command, check out Buck Hodges’s post here.


Q. How can I find all of the labels for a particular TFS project sub-folder?

Assume there is a TFS project Project with the subfolders trunk and 1.0. trunk contains the latest version of the application code for this project and 1.0 contains the code for the same application for the released version of the same name.

There are labels for both sub-folders and all of the labels include files in only one of the sub-folders. [You could also assume that the labels are recursive on a specific (maximum) changeset for all of the files in the entire sub-folder too if that simplifies your answer.]

How can I create a list of labels for one of these sub-folders, using Visual Studio, the TFS tf.execommand line tool, or any other tool or code that is publicly (and freely) available.

Note I’ve written T-SQL code that queries the TFS version control database directly to generate this info, but I’m curious whether there are ‘better’ ways to do so.

A: In Visual Studio, in the Source Control Explorer window, right-click the sub-folder for which you want to list the relevant labels and pick View History from the context menu. In the History window that should appear, there should be a sub-tab Labels that lists labels applied to that sub-folder (but not specific items in that sub-folder).


Q. TFS file must remain locked

I have some 3rd party dlls checked into TFS
Our machines were renamed and now TFS believes they are checked out for edit by me on another machine.

I tried tf lock /lock:none contrib64/* /workspace:oldmachine;myusername but I get the error

TF10152: The item $/XXX/YYYY/contrib64/third_party.dll must remain locked because its file type prevents multiple check-outs.

1, Is there any way around this ?
2, Is TFS really this bad or is it just me ?
3, Is the purpose of TFS to make us nostalgic for VSS?

ps It’s a hosted version so I can’t just get the admin to fix it.

A: Undoing the lock won’t work on those files because they are binary, as binaries cannot be merged they must be locked if they are checked out.

As the machine the workspace resides on no longer exists (the machine has been renamed) the best thing to do is delete the workspace.

from a Visual Studio command prompt

tf workspace /delete oldmachine;myusername /collection:http://*tfsserver*:8080/tfs/*collection*

This will remove the workspace and undo all pending changes


Q. difference between Product Backlog Item and Feature in Team Foundation work item types

I have a question about Microsoft Team Foundation. In Visual Studio, Team Explorer, I can create a new work item. Work item types here are dictated by your team’s chosen process template; I’m not sure which process template we’re using. In any case, in Team Explorer, when I want to create a new work item, I’m given a list of work item types to select from, among which are “Product Backlog Item” and “Feature”.

I noticed a difference between the two types related to the target resolution date. For a Product Backlog Item, this would seem to be dictated by the iteration end date. For a Feature, it’s not as clear. A Feature is also associated with an iteration (and iteration end date), however Feature also has a separate field called “Target Date”. The mouse hover text for target date is “The target date for completing the feature”.

Should I choose “Product Backlog Item” or “Feature” as the work item type for my new work items? What’s the difference between the two?

Screenshot_6

A: It looks like you are using the Scrum process template. The TFS site has published some very brief information about Product Backlog Items and Features and the idea behind creating a new work item type. http://www.visualstudio.com/en-us/news/2013-jun-3-vso.aspx

The difference between the two comes down to what granularity you want to work with your work items at:

  • Product Backlog Items are composed of Tasks and have estimated effort.
  • Features are composed of Product Backlog Items and have target dates.

I have not been able to find any official guidance on when to use Features vs Product Backlog Items but I have created my own guidance which I am basing this answer on…http://www.nsilverbullet.net/2013/06/04/features-help-us-plan-work-better-in-team-foundation-service-scrum-process/

Should you create a Feature or a Product Backlog Item?

  • If you think/hope that the new work item that you are going to create will fit into a single sprint you should create a Product Backlog Item and then break it down into tasks for your sprint.
  • If you think/know that the new work item won’t fit into a single sprint you should create a Feature and identify all the value-providing sprint sized items (Product Backlog Items) that the Feature can be broken down into and use these when planning future sprints.

[Update 2014-05-19]

Microsoft have published more information on how to use Features and the agile portfolio concept that has been implemented in TFS http://msdn.microsoft.com/en-us/library/dn306083.aspx


Q. Warning displayed when adding solution to Team Foundation Server 2010

I’m just getting to grips with TFS 2010 (never had any luck with TFS 2008) and I’m trying to add my first solution into TFS. However I am getting the following warning message:

The project that you are attempting to add to source control may cause other source control users to have difficulty opening this solution or getting newer versions of it. To avoid this problem, add the project from a location below the binding root of the other source controlled projects in the solution.

Can someone explain to me what this means and how to resolve it? This warning is displayed when right clicking on the solution in Solution Explorer and selecting “Add to Source Control”.

A: Your solution folder structure should resemble:

Skip code block

Solution Root folder
|
.sln solution file
|
Project1 folder
|
Project1.csproj   (or .vbproj)
|
Project2 folder
|
Project2.csproj   (or .vbproj)
.
.
.


Q. How to undo another user’s checkout in TFS via the GUI?

As the resident TFS admin, on occasion I am asked to undo a checkout (usually a lock) that a user has on a certain file. This can be done via the command line using the TF.exe utility’s Undo command (see http://msdn.microsoft.com/en-us/library/c72skhw4.aspx), but that’s kind of a pain.

Is there a way to undo another user’s checkout via the GUI?

A: Out of the box, no, but there are at least a couple of options via add-ons:

TFS Power Tools

Latest version can be downloaded here. Also includes links to older versions.

Once installed:

  1. Open Source Control Explorer
  2. Right-click the item on which checkout is to be undone (or a parent folder of multiple files to be undone)
  3. Select Find in Source Control and then Status
  4. In the Find in Source Control dialog, leave the Status checkbox marked
  5. Optionally, enter a value for the Wildcard textbox
  6. Optionally, enter a username in the “Display files checked out to:” textbox and select that radio button
  7. Click Find
  8. This will result in a list of files
  9. Select the items to undo
  10. Right-click and select Undo
  11. Click Yes when prompted with “Undo all selected changes?”

Team Foundation Sidekicks

Another option is to use the Team Foundation Sidekicks application, which can be obtained here:http://www.attrice.info/cm/tfs/

It has a Status sidekick that allows you to query for checked out work items. Once a work item is selected, there are “Undo pending change” and “Undo lock” buttons that can be used.

Rights

Keep in mind that you will need the appropriate rights. The permissions are called “Undo other users’ changes” and “Unlock other users’ changes”. These permissions can be viewed by:

  1. Right-clicking the desired project, folder, or file in Source Control Explorer
  2. Select Properties
  3. Select the Security tab
  4. Select the appropriate user or group in the Users and Groups section at the top
  5. View the “Permissions for [user/group]:” section at the bottom

Q. How to undo another users checkout in TFS?

As the resident TFS admin, on occasion I am asked to undo a checkout (usually a lock) that a user has on a certain file checked into source control.

How do you undo another user’s checkout?

A: There are at least 2 different ways to do this:

Command Line

There is a command-line utility called Tf.exe that comes with Team Explorer. Find the documentation here. It can be accessed by launching a Visual Studio Command Prompt window. The syntax of the command is:

tf undo [/workspace:workspacename[;workspaceowner]]
[/server:servername] [/recursive] itemspec [/noprompt]

For one file

tf undo /workspace:workspacename;workspaceowner $/projectname/filename.cs

GUI

The second is via the GUI, but does not come standard – you have to install the TFS Power Tools. See here for details on how to use this method.

.

Keep in mind that with either method you will need the appropriate rights. The permissions are called “Undo other users’ changes” and “Unlock other users’ changes”. These permissions can be viewed by:

  1. Right-clicking the desired project, folder, or file in Source Control Explorer
  2. Select Properties
  3. Select the Security tab
  4. Select the appropriate user or group in the Users and Groups section at the top
  5. View the “Permissions for [user/group]:” section at the bottom

Deleting the workspace

tf workspace /delete WorkspaceName;User
/server:http://server:8080/tfs/MyTeamCollection


Q. What’s a Backup and Recovery Process for Team Foundation Server 2010?

We have a new installation of TFS 2010 (on SQL Server 2008), and I’m planning the backup and recovery process.

It seems the configuration information and data is stored in the Tfs_Configuration and Tfs_DefaultCollection databases (and additional Tfs_[CollectionName] dbs if you have more than one collection). In a test setup, I tried backing up the two dbs, uninstalling TFS, then reinstalling (thinking I could then hook the databases up at some point in the install process). This is where I’m confused. I don’t see an option or clear guidance on how this is suppose to work.

A: Download the TFS Power tools and use the backup tool (it’s even got a nice GUI)!

If you have backed up your TFS 2010 databases and lose your TFS server, you can restore it by restoring all of your TFS databases, reinstalling TFS, and selecting the Application Tier option of the installation wizard. Once you point the wizard at your database, it will recognize the Tfs_Configuration database from the previous installation and restore your previous configuration as well as your collections.


Q. Conchango vs MS agile template on TFS 2010

Hi What is the diff between Conchango and the builtin agile template in TFS 2010. Any recommendations ? Thanks

A:

I have just written a blog that gives you a side by side comparison between:

  • Scrum for Team System v3
  • MSF Agile v5
  • TFS Scrum v1 (beta)

http://consultingblogs.emc.com/crispinparker/archive/2010/06/28/scrum-for-team-system-v3-0-msf-agile-v5-0-and-team-foundation-server-scrum-v1-0-beta.aspx

Crispin.


Q. Can we migrate to a new TFS process template and keep history?

We are currently using TFS 2008 with the Scrum for Team System template from Conchango, with a few minor tweaks. We are looking at upgrading to TFS 2010 and we are considering moving to the MSF for Agile template.

What is the best way to move to a new process template and keep history? I’d like to be able to create a new team project on the TFS 2010 server, get everything checked-in, and move our source to the new project. It would be nice if we could somehow keep the check-in comment history and possibly even be able to navigate back to the work item history associated with a changeset in the old project. I’d even be willing to migrate the old project as-is over to 2010 and then move the source to a new project, retaining the old project with work items only in 2010.

Has anyone gone through the process that can over some advice?

A: We are in a simalar situation that you are (right down to the templates we are on versus the one we want to be on), although we only have source code in our existing Team Foundation Server instance. We are planning to do a migration from Team Foundation Server 2008 to Team Foundation Server 2010, as opposed to an upgrade. Although we have not done so yet, you do have the have two options you have outlined.

Like you mention, you can migrate the source code and Work Item Tracking to a new Team Project using this tool. It will “compress” the history dates, as TFS will want to add its own timestamp. There will be some potential history issues, from what I understand. Specifically, in TFS 2010, you might have issues comparing versions from the pre-migrated source control. At least, so far, I have in my experiments in our test lab. My understanding of this issue is that it relates to item-mode vs. slotted-mode as the defaults between the two versions. I can look at individual versions and can see history – so that meets our requirements.

The other option is source control in one project and work items in another. I have not tried this, because I would imagine that the changeset relationships would be broken on existing work items and would not be generated going forward. This may or may not a be a big deal to you.

Also, it might be a good idea to describe your situation in the discussion area of the project on Codeplex. The authors are on the TFS Migration Team at Microsoft and depend on feedback of people in the same boat we are. I have been exchanging a couple of emails with them so far, and they have been quite helpful.

Based upon our discussions with the very helpful folks at Microsoft, we are likely going to backup the databases and follow the directions on Bryan Krieger’s blog post (Path 2: Migration Upgrade). I am hoping to make a test run at the upgrade using an older backup as early as next week.

Best of luck! I know it is intimidating. Luckily, my installation and configuration experiences with a fresh TFS 2010 install in the lab have been much more smooth than my initial exposure to the TFS 2008 process. Hopefully, you find the same is true.


Q. TFS 2010 enforcing Code Analysis in Gated Checkins

Hi Is it possible to enforce VS Code Analysis (FxCop) as part of the Gated Checkin policies? So the developers will not be able to checkin unless the CA is passed.

Thanks

A: Yes this is possible. Please see the following:

How to: Add Check-in Policies


Q. How to revert (Roll Back) a checkin in TFS 2010

Can anyone tell me how to revert (roll back) a checkin in TFS 2010?

A: Without using power tools or command line:

  1. ensure Tools->Options->Source Control->Visual Studio Team Foundation Server UNCHECK Get latest version of item on check out
  2. View the history of project folder in Source Control Explorer and right click on the changeset to roll back to and choose Get This Version
  3. Check out for edit on the project folder in the Source Control Explorer (this should keep your local version you just got from the history)
  4. Check in pending changes on the project folder in the Source Control Explorer
  5. if visual studio asks you to resolve conflicts, choose keep local and attempt check in of pending changes on the project folder in Source Control Explorer again

Q. Why should my small .NET development company upgrade from Team Foundation Server 2008 to 2010?

The company for which I work has an MSDN site license and upgrading to TFS 2010 from 2008 is not an expensive option. However, neither my colleagues nor I have been able to find any features that make this something we feel we need. Is anyone experienced with TFS 2010 enough to convince me that my company needs this?

To clarify: we have no intention of moving to a different source control product. The question is what features of TFS 2010 are worth an upgrade from TFS 2008?

A: disclaimer: I haven’t moved to 2010 yet either, but probably will

Biggest feature for me: (we use branching to manage large feature sets and to separate SPs, QFE’s, and major releases)

TFS 2010 will track changes across branches.
Example: suppose I change something in the Dev branch, and then you merge dev to main. Now suppose that someone uses the Annotate feature (on the main branch) to figure out who changed that code. In TFS 2008, it would report that you made the change (because you checked in the merge). Reportedly, TFS 2010 will be aware that I actually orginated the change in the dev branch, and it will be able to tell you that. That’s gold if you are using branching.

Also, correct me if I’m wrong, but didn’t they switch 2010 to use a single SQL database? (or maybe 1 for source control, and one warehouse?). If so, then the backup strategy gets a bit better. MS says that all of the TFS databases should be backed up from the same moment in time, but that’s tough to do when there are 5-odd databases (it’s very difficult to ensure that all of them reflect exactly the same point in time transactionally). If they have consolidated databases, then it should be easier.

One other: depending upon the level of MSDN that you have, TFS 2010 might be free for you now.


Q. How can I get TFS 2010 to build each project to a separate directory?

In our project, we’d like to have our TFS build put each project into its own folder under the drop folder, instead of dropping all of the files into one flat structure. To illustrate, we’d like to see something like this:

DropFolder/
Foo/
foo.exe
Bar/
bar.dll
Baz
baz.dll

This is basically the same question as was asked here, but now that we’re using workflow-based builds, those solutions don’t seem to work. The solution using the CustomizableOutDir property looked like it would work best for us, but I can’t get that property to be recognized. I customized our workflow to pass it in to MSBuild as a command line argument (/p:CustomizableOutDir=true), but it seems MSBuild just ignores it and puts the output into the OutDir given by the workflow.

I looked at the build logs, and I can see that the CustomizableOutDir and OutDir properties are both getting set in the command line args to MSBuild. I still need OutDir to be passed in so that I can copy my files to TeamBuildOutDir at the end.

Any idea why my CustomizableOutDir parameter isn’t getting recognized, or if there’s a better way to achieve this?

A: I figured out a nice way to do it. It turns out that since you can set the OutDir to whatever you want within the workflow, if you set it to the empty string, MSBuild will instead use the project-specific OutputPath. That lets us be a lot more flexible. Here’s my entire solution (based on the default build workflow):

In the Run MSBuild task, set OutDir to the empty string. In that same task, set your CommandLineArguments to something like the following. This will allow you to have a reference to the TFS default OutDir from your project:

String.Format(“/p:CommonOutputPath=””{0}\\”””, outputDirectory)

In each project you want copied to the drop folder, set the OutputPath like so:

<PropertyGroup Condition=” ‘$(Configuration)|$(Platform)’ == ‘Release|AnyCPU’ “>
<OutputPath Condition=” ‘$(CommonOutputPath)’==” “>bin\Release\</OutputPath>
<OutputPath Condition=” ‘$(CommonOutputPath)’!=” “>$(CommonOutputPath)YourProjectName\bin\Release\</OutputPath>
</PropertyGroup>

Check everything in, and you should have a working build that deploys each of your projects to its own folder under the drop folder.


Q. TF203015 The Item $/path/file has an incompatible pending change. While trying to unshelve

I’m using Visual Studio 2010 Pro against Team Server 2010 and I had my project opened (apparently) as a solution from the repo, but I should’ve opened it as “web site”. I found this out during compile, so I went to shelve my new changes and deleted the project from my local disk, then opened the project again from source (this time as web site) and now I can’t unshelve my files.

Is there any way to work around this? Did I blow something up? Do I need to do maintenance at the server?

I found this question on SO #2332685 but I don’t know what cache files he’s talking about (I’m on XP :\ ) EDIT: Found this link after posting the question, sorry for the delay in researching, still didn’t fix my problem

Of course I can’t find an error code for TF203015 anywhere, so no resolution either (hence my inclusion of the number in the title, yeah?)

EDIT: I should probably mention that these files were never checked in in the first place. Does that matter? Can you shelve an unchecked item? Is that what I did wrong?

EDIT: WHAP – FOUND IT!!! Use “Undo” on the items that don’t exist because they show up in pending changes as checkins.

A: Need to close, found the answer.

I had deleted the files in trying to reload the workspace, even though I had shelved the changes. Then VS2010 thought those files were still pending to save. I didn’t need that, so I had to figure out to “undo” the changes in Pending Changes.

Then I could unshelve.

It thought I had two ops (unshelve, commit-for-add) going simultaneously, and I thought I had only one op (unshelve).


Q. Share code between projects in tfs 2010

Hi
What is the best way to handle code sharing in TFS 2010? We have a couple of Visual studio projects that other Visual Studio projects use. ex:

Shared Project

Project 1 Solution
-Shared Project
-Project 1 Project

Project 2 Solution
-Shared Project
-Project 2 Project

Also we have Third party code for example:
Third Party
-Telerik
–2009.1.402.35
–2009.02.0701.35

When I open my “Project 1” solution i want my shared code project to be included in that solution. (thats the way we work today).
We basically have one TFS Project that contains all the code. Now we want to use it the “right” (?) way, We would like to have Project 1 and 2 in separate TFS solutions.

If I for example makes sure we have all our project in the same structure on disk and just add the shared project to my Project 1 solution (even if the projects reside in two different TFS Projects) would that work with builds?

How have you solved the problem, I guess we are not the only ones having shared code between projects?

A: I am not sure if there is a “right way” to share code using Team Foundation Server 2010. I would recommend that you check the following blog post as customers are sharing their learnings:http://blogs.msdn.com/jmeier/archive/2007/03/17/code-sharing-in-team-foundation-server.aspx.


Q. Standalone GUI client for TFS 2010 Source Control

I’m looking for a TFS 2010 GUI client that I can use outside of an IDE. I’m only looking to use the source control features in this case. I’m not talking about work items or build management.

Ideally it would be a complete client that can be used on a machine where Visual Studio is not installed.

Options I know about and why I’m not satisfied with them:

Are there others that I don’t know about?

A: You can install Team Explorer (on the TFS install DVD, or you can download it from MSDN) without needing to have VS2010 installed – Team Explorer will install a ‘shell’ VS2010 with only the TFS features available – none of the IDE components.

Update: the VS11 beta version is now available.

If you use eclipse I’ve heard good things about the teamprise stuff but haven’t tried it myself. They got bought by microsoft and now you can download the eclipse plugin here It also looks like it has a fully functional command line client that you could use instead of TFS Power Tools.

From the description: “Eclipse plug-in and cross-platform command-line client for Visual Studio 2010 Team Foundation Server”


Q. How can I copy a TFS 2010 Build Definition?

Is there any way to copy a build definition? I work in a mainline source control methodology which utilizes many different branches that live for very short periods (ie. a few days to a week). I’d really like to copy a build template and just change the solution to build. Is there any way to do this?

A: You can write an add-in to do it. Here’s the code to copy an existing build definition:

Skip code block

static IBuildDefinition CloneBuildDefinition(IBuildDefinition buildDefinition)
{
var buildDefinitionClone = buildDefinition.BuildServer.CreateBuildDefinition(
buildDefinition.TeamProject);

buildDefinitionClone.BuildController = buildDefinition.BuildController;
buildDefinitionClone.ContinuousIntegrationType = buildDefinition.ContinuousIntegrationType;
buildDefinitionClone.ContinuousIntegrationQuietPeriod = buildDefinition.ContinuousIntegrationQuietPeriod;
buildDefinitionClone.DefaultDropLocation = buildDefinition.DefaultDropLocation;
buildDefinitionClone.Description = buildDefinition.Description;
buildDefinitionClone.Enabled = buildDefinition.Enabled;
buildDefinitionClone.Name = String.Format(“Copy of {0}”, buildDefinition.Name);
buildDefinitionClone.Process = buildDefinition.Process;
buildDefinitionClone.ProcessParameters = buildDefinition.ProcessParameters;

foreach (var schedule in buildDefinition.Schedules)
{
var newSchedule = buildDefinitionClone.AddSchedule();
newSchedule.DaysToBuild = schedule.DaysToBuild;
newSchedule.StartTime = schedule.StartTime;
newSchedule.TimeZone = schedule.TimeZone;
}

foreach (var mapping in buildDefinition.Workspace.Mappings)
{
buildDefinitionClone.Workspace.AddMapping(
mapping.ServerItem, mapping.LocalItem, mapping.MappingType, mapping.Depth);
}

buildDefinitionClone.RetentionPolicyList.Clear();

foreach (var policy in buildDefinition.RetentionPolicyList)
{
buildDefinitionClone.AddRetentionPolicy(
policy.BuildReason, policy.BuildStatus, policy.NumberToKeep, policy.DeleteOptions);
}

return buildDefinitionClone;
}


Q. Is MSBuild going to be dead because of Windows Workflow?

MSBuild in TFS 2010 has been replaced by Windows Workflow 4.0. It means when you are creating a Build Definition, you won’t have a TFSBuild.proj to edit instead you must edit a workflow to customize your build.

BTW am I correct if I say Microsoft is not supporting MSBuild in TFS 2010 and learning MSBuild as a TFS 2010 Team Build administrator doesn’t worth?

And another more question: is Microsoft going to replace Visual Studio Projects’ language from MSBuild to something like Windows Workflow?

A: I’m the Program Manager for the build automation features of TFS, so I’d like to comment on this question. We haven’t replaced MSBuild with Windows Workflow (WF). We still very much rely on MSBuild as the core build engine, which is its core competency. You’ll find that there are lots of tasks that are still most easily and effectively automated with MSBuild.

We introduced WF as a way of providing a higher level orchestration layer on top of the core build engine (which is MSBuild in the build process templates we include in the box). It makes it possible to do things like distribute a process across multiple machines and to tie the process into other workflow-based processes.

So, when should you automate with MSBuild and when should you automated with WF? Here’s my general guidance on that subject:

  • If the task requires knowledge of specific build inputs or outputs, use MSBuild
  • If the task is something you need to happen when you build in Visual Studio, use MSBuild
  • If the task is something you only need to happen when you build on the build server, use WF unless it requires knowledge of specific build inputs/outputs

When using MSBuild, remember that you can customize your project files directly (by unloading them and then editing them in Visual Studio), or you can create custom .targets files and import them into your individual projects. The latter approach is useful for functionality that’s common to multiple projects to avoid maintaining multiple copies.

When using WF, remember that you can write code activities for low-level tasks but that you can also compose higher-level tasks using straight XAML. We’re actually working on a version of the default build process template that shipped with TFS 2010 that gives you a simpler, less granular view of the overall process by using a set of composed XAML activities.


Q. Using the edit – merge – commit workflow in TFS Source Control

Ive been using sourcegear vault and subversion/visual svn for quite a while now and am a big fan of the CVS disconnected style “Edit -> Merge -> Commit” way of using source control.

Since we moved to TFS 2010 i have been reintroduced to the horrid “checkout -> edit -> checkin” sourcesafe style way of working. Meaning only one user can work on a file at any time.

I cant find anything that suggests this can be changed.

Is it possible?

A: Checkouts in TFS aren’t generally exclusive. By default, multiple users can checkout a single file. Exceptions are binary file types like JPGs, PNGs, etc. which are checked out exclusively by default.

Once you’re ready to commit your changes, you can use the Pending Changes tool window to check for conflicts and merge if necessary.


Q. How to Add/Edit the Iteration Field in Team Foundation Server Scrum v1.0 beta Workflow

I downloaded and installed the new Team Foundation Server Scrum v1.0 beta work template from Microsoft. I would like to edit the drop down that displays in the Iteration field used when entering a new Sprint work item. If I enter in a release / sprint number that does not exists I get the following message.

“New Sprint 1: TFS20017: The ara or iteration provided for field ‘Iteration Path’ could not be found”

Does anyone know where I need to go to edit this listing?

A: Connect to TFS.

  1. In the Team Explorer, select the team project you want to define the iterations for.
  2. Click on theTeam menu item in the Visual Studio menu bar.
  3. Choose theTeam Project Settings sub-menu
  4. ChooseAreas and Iterations…
  5. Add sub-nodes as necessary for areas or iterations.

Areas and Iterations are defined on a per-project basis, so if you are in one team project when you define them, you won’t be able to access them from another team project.


Q. Move projects between collections in TFS 2010

I’d like to move some projects between collections but the only resources I’ve found are these two and they don’t address how to do this in TFS 2010:

Does anyone know of any other resource or has information on how to move a project from one collection to another?

A: You could look at the TFS Integration Platform (formerly called the TFS to TFS Migration Tool). That has utilities for moving source code from one instance of TFS to another, which should work if you want to move from one collection to another as well.


Q. Error TF218027 when creating a Team Project in TFS 2010

Consider the scenario of a user creating a new Team Project. The user is a developer who wants to create and manage their Team Project.

  • Why can’t this user create a new Team Project, including the Reporting Services components?
  • What can be done to resolve this error?

The exception is

TF218027: the following reporting folder could not be created on the server running SQL Reporting Services.

SQL Reporting services is running under an Active Directory service account created expressly for this purpose.

The developer attempting this action is a member of a TFS group with the following permissions.

A: I actually blogged about this not too long ago. You usually see this error if Reporting Services gets set up with something other than the NETWORK SERVICE account.

FTA:

I was playing around with my test instance of Team Foundation Server today, trying to create a new project, when I got error TF218027 when it tried to create the Reporting Services folder for the project. The strange thing was, this was not my first project created on this server.

I searched the Internet for anything similar, and found a post that said Reporting Services should be run with the NETWORK SERVICE account. Since this was a hastily put together server, I was running it with the Administrator account, so I tried switching it over.

No dice. I got the same TF218027 error, but this time it was due to it not being able to decrypt the symmetric keys. Apparently, it’s a bad thing to change the account on the Reporting Services service.

I hastily changed the account back to Administrator and resarted the service. Interestingly enough, this seems to have fixed the problem.


Q. Can’t manually add files to TFS

We use Codesmith to generate some code, and when we open up the projects, the files are there, in the solution, but there is no way to check them in. The DLL compiles just fine. The only difference to the .csproj is the addition of any new files we generated.

But unlike VSS, TFS, does not detect these files. I validated this behavior by editing the .csproj manually. For some reason, the only way to add a file to TFS is through Visual Studio.

However, when I remove them from the project, and then include them, I get the usual yellow plus sign.

A: You can manually add files to Visual Studio, however changing your project file isn’t the best way to do this. If your project is already under source control and the files you want to add are visible in the Solution Explorer window, you can simply right-click a file and select Include in project. The next time you check your code in, the items will be added.

Since you’re using TFS 2010, check out the Team Foundation Server Power Tools extensions. This includes the Windows Shell Extensions which give you integration into Windows Explorer which let’s you right click on files or folders and add the to TFS outside of Visual Studio. Very nifty!


Q. Fetching the comment history for a work item in TFS

In most defect trackers there is a comment history associated with a ticket/incident/issue/work item.

I wish to get this same information from TFS via the SDK for a work item – ideally:

  • Who created the comment.
  • The text of the comment.
  • Who last updated/edited the comment (if that’s event possible in TFS?)

I have determined that a WorkItem has a collection of revisions availabe via the “Revisions” property, and that you can loop through each revision – but a revision does not have a “History” property where I assume I could find the comment created by the user. Also I don’t believe it’s compulsory to record a comment with each change – so I suspect I will need to ignore revisions that don’t have any history property information?

Revisions Property on MSDN

Any thoughts on the best way to fetch this “comment history” information for a work item in TFS – is the revisions list the correct way, or should I be using some other part of the API?

A: In order to fetch the comment history you need to access the “History” property on the Work Item revision.

WorkItem.History Property

Obviously the current (latest) version of the work item will have this field as empty, but historical revision comments will be there.

TFS: Getting workitem history from the api

The “History” displayed on a work item in Team Explorer is built by looping through the Revissions and displaying both the fields that were changed and the text in the “History” property


Q. Getting “Failed to create mapping” when adding a solution to TFS source control

I’ve created a new Team Project in TFS, but when I try to add my solution to it I get:

‘Failed to create mapping

Cannot map server path, $/Finance/MyApp, because it is not rooted beneath a team project.’

I can’t find anything on google or here that looks remotely like this problem.

A: I had this issue when using Microsoft’s Team Foundation Service from Visual Studio 2012. I had just created the new team project via the TFS website. Although I could see my new project in the ‘add solution’ window, I got the error the OP reported.

I had to go into the “Team Explorer” window, then into “Connect to Team Projects” and tick the new project. Then I was able to add my solution to the team project.


Q. Why TFS does not allow multiple collections to be connected with a single same Build Controller?

According to here and here TFS 2010 does not allow multiple project collections to use a same Build Controller. Why? I’m going to setup some another more build controller as virtual machines. But it seems somehow not practical. Because our company is going to have several project collections. Is it a good work-around? Is there any better work-around except that using a single project collection for all projects?

A: There is a hack to use a single server as a build controller for multiple collections:http://blogs.msdn.com/b/jimlamb/archive/2010/04/13/configuring-multiple-tfs-build-services-on-one-machine.aspx

You should use a new collection when you want the isolation. Examples why you want it are:

  • Security
  • Handover
  • Isolation for multiple customers

Q. Configuring TFS2010 so users can create/update bugs but modify nothing else

Environment: I am administrator of a project in TFS 2010, but don’t have any administrative rights for the project collection.

Is there an easy way that I can set up access rights for a group of users so that they can:

  • Create/update “Bug” work items only
  • View all other work items
  • Execute work item “Team Queries” and create their own queries
  • No access to source control

The idea is I want them to enter bugs, but I don’t want them creating/modifying User Stories or Tasks, nor do I want them to have access to source control.

From what I can see, the standard groups don’t have fine enough control:

  • Contributors can create all work item types
  • Readers can view files in Source Control as well as work items.

UPDATE

Limiting access to Source Control is covered by Ewald’s answer.

However Ewald also indicates that there isn’t a realistic way to set up security on the “Work Item Type” level so that users can only enter/update bugs. He suggests it could be achieved by customising every work item definition and setting field rules for every field on every work item type, but this is a lot of work, and in any case I want to avoid customising the process template.

I’ve therefore created an issue on Connect for this:https://connect.microsoft.com/VisualStudio/feedback/details/591121/configuring-tfs-project-so-that-users-can-create-update-bugs-but-modify-nothing-else

A: Having recently migrated from VSS to TFS2010 I haven’t looked back. I love the way everything is integrated. Without restating what was said before some of the great features are:

  • Proper branching & merging
  • AD integration, no more setting up users in VSS
  • Easy to see who has what checked out
  • Easy to see check-in history (great for code reviews)
  • TFS Power Tools add custom check-in policies and Windows Explorer context menu
  • Work items, tracking and their association with changesets
  • Inbuilt reporting
  • Team Project Portals – so non developers can access TFS reports/work item info etc
  • Speed, it’s so much faster than VSS
  • Source is stored in SQL server and check-in operations are transactional and not file based, no more running VSS clean up

I found that rather than migrating source code using the migration tool a fresh check-in was the quickest way, keeping SourceSafe in read-only for the odd time I have to refer to the history.


Q. Set up user permissions for Team Foundation Server 2010

We have installed TFS 2010 with success but wonder how to set the users permissions. We are small projects with five developers, a manager and a secretary. Each developer is working itself with one or more projects, we have no cooperation between any projects. We want everyone to be able to see all the code for each project, but that only those who are responsible for the code to change it. However, we want everyone to create Work Items for all projects. How should we set this up?

A: For detailed information about TFS 2010 permissions you can check thishttp://msdn.microsoft.com/en-us/library/ms252587.aspx

If you want a user to be able to read the source code you have to give him/her only Read permission and to prevent him from changing code you have to deny check out and check in permissions. You can set these permissions by right clicking the folder or file in Source Control Explorer, Clicking Properties and clicking Security tab.

For Work Items you have to give WORK_ITEM_WRITE and WORK_ITEM_READ permissions. You can do by right-clicking the project in Team Explorer, clicking Areas and Iterations, and on the Area tab, clicking Security


Q. Adding parameter to “Queue New Build” Dialog

I built a custom build processes template based on the DefaultTemplate.xaml and added a few parameters. They show up fine on the Build definition window but I can not find a way to have them be displayed on the parameters tab of the Queue New Build Dialog.

I am hoping that this is possible, I would rather not need to define a separate build for each variation of parameters.

A: You can define that in the Metadata parameter:http://www.ewaldhofman.nl/post/2010/05/17/Customize-Team-Build-2010-e28093-Part-6-Use-custom-type-for-an-argument.aspx

You can play with the “View the parameter when” option at the bottom


Q. Branching in TFS 2010 and being forced to re-download the code

When i create a branch from the mainline in TFS 2010 i have to download all of the code i have just branched.

I already have the latest mainline version on my laptop so why is TFS requiring me to effectively download whats already on my hard disk?

Even if i copy the mainline files into a folder and map the new branch to this folder it still performs a fully recursive get and chokes our bandwith for 30 minutes or so.

This seems like such a waste of time and bandwith – is their a workaround/procedure that i am not aware of?

A: For faster switching between branches, give the tf get /remap option a try. From Brian Harry’s blog:

This is a new option on tf get that is intended to be used when you want to switch your workspace from one branch to another in the same code base. You first change the workspace mapping and then issue a tf get /remap. Because a large percentage of the files in two related branches are frequently identical, this command optimizes for that. Rather than downloading all the content, it will only download the things that are different between the two branches. I can reduce the get of a very large workspace from 10’s of minutes to a few seconds.

Note that this requires TFS 2008 SP1 or later.


Q. How to update current sprint team queries in TFS 2010?

We are using VS 2010 and TFS 2010 with the Microsoft Scrum Template.

We use the Team Queries for the Current Sprint like the Sprint Backlog query.

The problem is when we move to sprint 2 the “Current Sprint” still points to sprint 1.

Is there a way to to tell TFS that we are now currently in sprint 2 and have the queries use a variable to run against instead of hard-coding the sprint?

For example: If you look at the screen shot below you will notice that the definition of the query uses a variable called “@Project” for the team project. Is there a way to have a variable for the sprint?

Screenshot_7

A: Tom,

What you are asking for is not available in TFS 2010. There are not even dates on the iterations, so TFS does not know what the current iteration is.

In TFS11 (vNext) we have added the dates on the iterations. It now knows in which iteration you are, and this is also reflected on the backlog page in web access. In the preview version that is out now it is however not possible to add a filter clause to your queries to filter on the current iteration (something like @CurrentIteration). We have heard strong feedback to add this in the product before it ships. It is also very high on our wish list, but we need to fix other things first before we can ship.

You can add this request on User Voice. If the idea gets lots of votes it makes it easier to build a case that we need to put this in. But we cannot promise anything.

Ewald – TFS Program Manager


Q. Removing branch mapping in Team Foundation Server 2010

I’ve got a solution in source control with multiple projects. When I first migrated old code to TFS, I created main, dev, release areas for branches. Being new to TFS at the time, I branched a single project to the dev area, which created the little silver branch icon to show the relationship between them. Having done that, of course, I can no longer branch above or below that spot. So, I can’t branch a whole solution.

I tried removing the mapping/association of branches so that I could branch from higher in the tree, but can’t find a way to do that. I backed up source control and deleted all other associated branches except for the original one in the Main branch, but the association is still there despite having deleted the others (I assume TFS still contains history of those associations to the other branches I created).

My question is: How do I safely remove branch associations (the silver branch icon) while keeping history if possible (I don’t care about being able to merge anymore), so that I can branch from another area higher or lower in the tree?

A: Evidently, the right-click menu does not have this option due to user feedback. It can be accessed via File > Source Control > Branching and Merging > Convert to Folder

Source: Microsoft Connect


Q. Email Notifications/Alerts from Builds in TFS 2010

I am having problems getting the team alerts to work in TFS 2010.

Under “Team > Project Alerts”, I have checked the box to send both myself and a colleague an email upon a completed build. I know I have entered the correct email addresses, correct syntax as far as separating the emails, yet neither I nor my colleague receive any emails when the build is complete.

So far, I haven’t found anything online regarding troubleshooting this issue. I was wondering if anyone has encountered the same problem or otherwise knows of a solution to this problem.

A: Usually this boils down to a configuration problem within the TFS setup.

If you have access to the tfs server, run the TFS Administration Console.

If you click on TFS / Application Tier on the left, you’ll see the Application Tier settings come up. Scroll down to the Email Alert Settings.

Make sure it’s enabled and has the correct configuration for sending messages.


Q. Can you do a TFS get without needing a workspace?

I’m trying to change our build scripts from using SourceSafe to TFS without using MsBuild (yet).

One hiccup is that the workspace directory is renamed and archived by the scripts, which makes TFS think it doesn’t need to get any files. Even with the /force flag it just gets the directories without getting the source files.

I am currently using

TF.exe get “Product/Main/Project1”  /force /recursive /noprompt

To save me managing workspaces in the scripts or using intermediate directories, does anyone know of a command that can get directories and code without needing a workspace?

A: It’s not possible to run a tf get without a workspace. The reason is that the server needs to know the mapping between the server paths and the local paths.

If you are working with a large number of files, it is not a good idea to:

  1. Create & Delete a new workspace every time
  2. Or, Create a new workspace (and then never delete it)

The reason for this is that every time you do a Get, the server keeps track of which files, at which versions were downloaded to which workspace. If you never clean up these workspaces, then the table that stores this information will grow over time.

Additionally, if you are creating & deleting a workspace all the time, the server has to write all these rows, then delete them when you are done. This is unnecessary.

You really should try and reuse the same workspace each time. If you do, the server is very efficient about only sending you files that have changed since you last downloaded them. Even if your build is moving from one branch to another, you can use tf get /remap which is sometimes more efficient if the branches share common files.

Although it doesn’t solve your problem, it is possible to list files and download files without a workspace.

To list files:

tf dir $/Product/Main/Project1 /R

To download a file:

tf view $/Product/Main/Project1/file.cs

With a creative batch file, you can string these two together with a FOR command. However I would recommend trying to solve your workspace problem first, since that is the way that TFS was intended to be used.


Q. Why and when to have multiple build agents?

Consider TFS 2010’s ability for a Build Controller to have 1+ build agents. Since builds are a subjective topic to the team/environment, consider an environment where builds are performed on commit/check-in. Each Project Collection will have 10+ Team Projects, but perhaps only 1 or 2 are being committed to in a day.

  • When should a TFS administrator consider creating a new build agent?
  • Do multiple agents run in parallel?
  • When a single agent is defined to a Build Controller, does it run serially?
  • MSDN states: “if you set up your agents to have specialized capabilities…”. What does this mean? A technology/platform differentiator? How can you setup your agents to have specialized capabilities?
  • How can ‘tagging’ build agents be used effectively in an environment where builds are (typically) performed on each check-in.

A: You use multiple build agents to support multiple build machines (I work currently with a build farm with 3 build machines – and thus 3 build agents – to distribute the load).

You also might want to have multiple build agents to be able to run builds in parallel. This is a nice feature to share resources, but a requirement when you start working with Test/Lab Management features.

With the capabilities: for example you can setup a build agent with version 1 of a 3rd party component, and a second build agent with version 2. With tagging you can specify in the build definition which build agent it will choose from out of the pool of build agents.


Q. Team Foundation Server: Assign work item to a group instead of an individual user

In TFS 2010, is there a way that I can assign a work item to a group (i.e. Developers or Designers) instead of an individual user? I’d also want to be able to create a query so that we can filter on that group as well.

A: Yes, you can. If your group is a member of the larger group that can be assigned to, then it will appear in the list of assignable users.

For example, a user hierarchy might be like this:

[Assignable Users]
[Developers]
[Project Managers]
Mark Avenius
Joe Schmoe

EDIT As for the query, you can have the clause Assigned To contains @Me, which I believe will do what you want.


Q. How can this be achieved with Team Build 2010?

A: This blog post should help you out:http://blogs.msdn.com/b/willbar/archive/2011/02/05/splitting-team-build-outputs-into-folders.aspx

Essentially, you create a new ‘Platform’ for each project. Team Build will put each platform in a different directory by default, so you get a different directory for each of your projects.

Build configuration dialog:

Screenshot_8

Drop folder output:

Screenshot_9


Q. Multiple copies of a solution on one user/machine with TFS 2010

Is there a way to pull two copies of a single solution from TFS 2010 for the same user/machine?

A: You can have multiple copies of a single solution either by having multiple branches in TFS or by setting up different workspaces.

The branches are good for when you need to be able to check in code for both copies of the solution, and have other people work with it too.

I use the multiple workspaces when I need to have a last good state of the code on my dev box while at the same time and still working on new features.


0 Responses on TFS Interview Questions"

Leave a Message

Your email address will not be published. Required fields are marked *

Copy Rights Reserved © Mindmajix.com All rights reserved. Disclaimer.
Course Adviser

Fill your details, course adviser will reach you.