I followed Yanhua's link to a Microsoft article and found a workaround that I liked more than deleting random files:
Use vstest.console.exe instead of mstest.exe.
Please note that the arguments for vstest.console.exe are different. He wants the test.dll space-separated list to be
"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" "TestProject1.dll"
Here is my msbuild setup that does the same:
<PropertyGroup> <MSTEST>"$(VS110COMNTOOLS)..\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe"</MSTEST> </PropertyGroup> ... <Target Name="MyTests" > <ItemGroup> <TestFiles Include="..\Tests\**\bin\$(Configuration)\*.Test.dll" /> </ItemGroup> <PropertyGroup> <TestSuccessOrNot>1</TestSuccessOrNot> </PropertyGroup> <Exec Command="$(MSTEST) @(TestFiles, ' ')" > <Output TaskParameter="ExitCode" PropertyName="TestSuccessOrNot"/> </Exec> <Error Text="Tests Failed" Condition="$(TestSuccessOrNot) == '1'" /> </Target>
mdiehl13
source share