Team Foundation Service is getting chart pinning and load imporvements

Team Foundation Service is getting chart pinning and load imporvements

Last Friday Visual Studio team has pushed new bits to Team Foundation Service – chart pinning and load improvements. Read details in Brian’s post.

Tools that simplify your TFS management’s life

TFS Team Project Manager

Automates various tasks across Team Projects in Team Foundation Server. If you find yourself managing multiple Team Projects for an organization and have recurring tasks and questions that repeat themselves over and over again, Team Project Manager probably has some answers for you.

TFS Team Project Manager

TFS Event Manager

Allows you to manage Team Foundation Server event subscriptions as well as help troubleshoot event job processing.
If you’ve read Grant’s blog you’ll know why this is convenient.

TFS Event Manager

TFS Workspaces Cleaner

Deletes Team Foundation Server workspaces that have not been accessed in a number of days, along with their files locally on disk.
This is especially useful on build servers, where build definitions that have not run in a while can take up large amounts of disk space (which is not even cleaned up by build retention policies). Since it is a command-line tool, this cleanup can easily be automated as a Windows Scheduled Task.

TFS Workspase Cleaner

TFS Storage Explorer

Allows browsing the Team Foundation Server (non-version control) storage for TFS 2013 or above.
In case you’re wondering (like me) where the default build process templates are now being stored and what else is stored outside of version control.

TFS Storage Manager

Running unit tests that use Microsoft Fakes on Team Build

As you may know I worked on TFS Branch Tool which is one of the ALM Rangers solutions. As usual we are dogfooding latest technology and at some point our builds started failing. We tried to investigate cause and found that product team deployed latest VS 2013 bits into golden image of the agent. We identified that some of the tests that use Microsoft Fakes are failing on hosted build. Don’t be surprised that everything was fine on developer’s computer. So, business as usual.

As it often happens in developer’s life finding of the root cause usually takes 90% of time that needed for solving an issue. Symptoms were very strange – failing unit tests behaved same way like Fakes aren’t running at all. In our case we tested the code that uses Team Foundation Client OM and we had shims to avoid connection to real Team Foundation Server. So, tests are failing because code under test is trying to set up connection to real server.

To narrow down the problem I made few tests proving that Fakes are working on hosted team build if I shimming System.DateTime for example. Then I’ve created fresh new test project and put tests of Team Foundation Client here. Obviously, it working fine. Then it took just few minutes to find a difference between initial project and new one.

Here what I found. Historically Branch Tool was designed using Visual Studio 2012 and Team Foundation Server 2012 object model. Thus, we had references to v. 11 of Microsoft.TeamFoundation.* assemblies. For some reason all references had “Specific Version” option set to “False”. That would allow IDE to use newer version of that assembly if found on the computer. In the project files this looks like:

<ReferenceInclude=Microsoft.TeamFoundation, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL>
  <HintPath>..\..\..\..\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\ReferenceAssemblies\v2.0\Microsoft.TeamFoundation.dll</HintPath>

Reference resolution works pretty consistent between Visual Studio and Team Build but not for the Fakes. It appears that Fakes engine resolves references different way when executing via Team Build. It ignoring value of the “Specific Version” option and always considering it as the true.

We getting into the trouble as soon as we have newer version of Microsoft.TeamFoundation assembly on the computer. Code under test is compiled with reference to v. 12 of the assembly. Fakes framework is ignoring attempt to load of Team Foundation object model types as it expects v. 11. As result, all shims aren’t working at all.

Resolution is very simple – set “Specific Version” option to “True” and use v. 11 assembly explicitly or change reverence to v. 12 assembly if you need fresh Team Foundation object model.