We had a problem when we've integrated the tests into the build process.
In the TestRunConfig file (.testrunconfig) you can configure deployment items to be copied into the test run directory. The thing is that Visual Studio stores the path with ending backslash and because of annoying bug the deployment items are not copied during the TFS build. This does not happen while working inside Visual Studio environment.
The solution was to open the file in a text editor and remove the ending backslash from all the deployment items. We also removed write permissions from this file so nobody will recreate the problematic paths in the file.