Search code examples
visual-studio-2015vstesttfs-2015

VSTest console doesn't work from another base directory


I have a Windows 2012 Server with TFS2015 and VS2015. Somehow my tfs build doesn't generate unit-test results. I pin pointed the problem. I logged on the server and execute the following command in a "MSBuild Command Prompt for VS2015" (exactly the same as TFS does):

C:\Program Files (x86)\Microsoft Visual Studio 14.0>"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" "C:\_tfsWork\05894744\SoftwareDevelopment\ConsoleTest1\ConsoleTest1.UnitTest\bin\Debug\ConsoleTest1.UnitTest.dll"

I got no errors, but there is also no result. If i use the /ListTest parameter it does find the test. When I change my path in the prompt to the folder that contains the test assembly and execute the command again, it works. Can anybody explain what I'm doing wrong here? (or what TFS is doing wrong)


Solution

  • It's solved. The problem was the file filter for the test dll's. It included the

    Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll
    

    When I removed this file by excluding all Microsoft.*.dll, the test worked in TFS.