Two Keys to Successful Transformation
May 2, 2016
With SonarSource Co-Founder and Leadership Team
Fix Your Leaky Code
June 25, 2016
Show all

Tech Tip: Intermittent Errors

debugging tip for phantom errors

Debugging Tip for Phantom Errors

This is a quick tip to help you find and fix errors that, on the surface may appear intermittent. It’s an “oldie but a goodie” tip that I still have to get out of the toolbox on occasion for a given client.

During times of frequent changes, both new and rollbacks to previous versions, you may get tripped up by the cache that controls the interaction between Visual Studio, and an on-premise version of TFS. This is particularly important for developers who are working on new code and legacy code, in older and newer versions of Visual Studio and TFS.


  1. Checking files into the repository, getting confirmation of a successful commit, but then other people are not able to pull your latest code.
  2. The history appears ok, even to the point of correctly displaying the differences between recent versions.

Meanwhile, all appears to be fine on the surface, according to the TFS client that you are using! So first, make sure that you have truly diagnosed the problem that you are about to fix.

debugging tip for phantom errors

Debugging Tip for Phantom Errors

(Photo credit: Franz & P via / CC BY-NC-SA)

Tip Steps

  1. Set up an alternate workspace, and map it to a different local folder.
  2. Get the latest code in the new workspace.
  3. Diff between the two local versions (NOT the server versions, as that will appear to be fine).
  4. This will confirm that your expected change did not persist to the repository after all.
  5. Close Visual Studio and clear your cache.

That’s it! Now, of course, you’ll have to delete the cache for as many versions of TFS that you are connected to. If you have a few, you may want to create a script like this, then schedule it to run periodically. Otherwise, just manually delete it.

Note that the path you select depends on the operating system that you are using. It may appear as one of the following.

Happy Hunting!