Description
The test output includes "System.IO 4.1.2.0"  and the following binding redirect in TestAssembly.dll.config
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <dependentAssembly>
    <assemblyIdentity name="System.IO" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
  </dependentAssembly>
</assemblyBinding>
The test passed in Visual Studio. However, the test failed in the build machine as the following error.
An exception occurred while invoking executor 'executor://mstestadapter/v2': Could not load file or assembly 'System.IO, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies
I also notice if I manually removed TestAssembly.dll.config from the output folder, the test started to pass in the build machine.
Steps to reproduce
In VSTS build, run the latest Visual Studio Test task.
Expected behavior
Test pass.
Actual behavior
2017-10-19T23:47:12.3630779Z Starting test execution, please wait...
2017-10-19T23:47:19.4800462Z Error: An exception occurred while invoking executor 'executor://mstestadapter/v2': Could not load file or assembly 'System.IO, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
2017-10-19T23:47:19.4800462Z
Environment
Operating system : WS2016
VS2017 15.4.1
Visual Studio test runner 2.1.15
Package version of MSTest:
"MSTest.TestAdapter" Version="1.2.0"
"MSTest.TestFramework" Version="1.2.0"