Home
%3CLINGO-SUB%20id%3D%22lingo-sub-697645%22%20slang%3D%22en-US%22%3ETest%20execution%20failing%20when%20a%20Data-Driven%20test%20methods%20is%20referring%20parameter%20values%20from%20a%20test%20case%20WorkItem%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-697645%22%20slang%3D%22en-US%22%3E%0A%20%26lt%3Bmeta%20http-equiv%3D%22Content-Type%22%20content%3D%22text%2Fhtml%3B%20charset%3DUTF-8%22%20%2F%26gt%3B%3CSTRONG%3EFirst%20published%20on%20MSDN%20on%20Nov%2007%2C%202016%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%20Recently%20we%20are%20getting%20cases%2C%20where%20users%20get%20the%20below%20error%20when%20a%20data-driven%20test%20method%20is%20referring%20parameter%20values%20from%20a%20test%20case%20WorkItem.%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20Test%20execution%20failure%20error%3A%20%3CBR%20%2F%3E%3CBLOCKQUOTE%3E%3CSPAN%20style%3D%22color%3A%20%23333333%22%3E%20%3CEM%3E%20The%20unit%20test%20adapter%20failed%20to%20connect%20to%20the%20data%20source%20or%20to%20read%20the%20data.%20For%20more%20information%20on%20troubleshooting%20this%20error%2C%20see%20%22Troubleshooting%20Data-Driven%20Unit%20Tests%22%20(%3CA%20href%3D%22http%3A%2F%2Fgo.microsoft.com%2Ffwlink%2F%3FLinkId%3D62412%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Fgo.microsoft.com%2Ffwlink%2F%3FLinkId%3D62412%3C%2FA%3E)%20in%20the%20MSDN%20Library.%20%3CBR%20%2F%3E%20Error%20details%3A%20Could%20not%20load%20file%20or%20assembly%20'Microsoft.TeamFoundation.TestManagement.Controller%2C%20PublicKeyToken%3Db03f5f7f11d50a3a'%20or%20one%20of%20its%20dependencies.%20The%20system%20cannot%20find%20the%20file%20specified.%20%3C%2FEM%3E%20%3C%2FSPAN%3E%3C%2FBLOCKQUOTE%3E%3CBR%20%2F%3E%20To%20resolve%20the%20error%20above%2C%20follow%20the%20steps%3A%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20Add%20a%20runsettings%20file%20in%20the%20test%20project.%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20Append%20the%20text%20below%20in%20the%20runsettings%20file%3A%20%3CBR%20%2F%3E%3CBLOCKQUOTE%3E%3CSTRONG%3E%3CEM%3E%3CRUNSETTINGS%3E%20%3C%2FRUNSETTINGS%3E%3C%2FEM%3E%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CSTRONG%3E%20%3CEM%3E%20%3CMSTEST%3E%20%3C%2FMSTEST%3E%3C%2FEM%3E%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CSTRONG%3E%20%3CEM%3E%20%3CFORCEDLEGACYMODE%3Etrue%3C%2FFORCEDLEGACYMODE%3E%20%3C%2FEM%3E%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CSTRONG%3E%20%3CEM%3E%20%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FBLOCKQUOTE%3E%3C%2FLINGO-BODY%3E%20%20%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CSTRONG%3E%20%3CEM%3E%20%3C%2FEM%3E%3C%2FSTRONG%3E%3CBR%20%2F%3E%20Select%20the%20runsettings%20file%20and%20then%20execute%20the%20test%20case.%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20In%20case%20you%20are%20running%20the%20test%20on%20a%20test%20agent%20machine%20as%20a%20part%20TFS%20build%2C%20you%20need%20Visual%20Studio%202015%20on%20the%20test%20agent%20machine.%20%3CBR%20%2F%3E%20Also%2C%20configure%20the%20runsettings%20file%20with%20the%20%3CSTRONG%3E%20%3CEM%3E%20ForcedLegacyMode%20%3C%2FEM%3E%20%3C%2FSTRONG%3E%20tag%20in%20the%20test%20execution%20step.%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20Content%3A%20%3CSTRONG%3E%20Sinjith%20Haridasan%20Reeja%20%3CBR%20%2F%3E%20%3C%2FSTRONG%3E%20Review%3A%20%3CSTRONG%3E%20Deepak%20Mittal%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-697645%22%20slang%3D%22en-US%22%3EFirst%20published%20on%20MSDN%20on%20Nov%2007%2C%202016%20Recently%20we%20are%20getting%20cases%2C%20where%20users%20get%20the%20below%20error%20when%20a%20data-driven%20test%20method%20is%20referring%20parameter%20values%20from%20a%20test%20case%20WorkItem.%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-697645%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3Etest%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Etfs%202015%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Evnext%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
First published on MSDN on Nov 07, 2016
Recently we are getting cases, where users get the below error when a data-driven test method is referring parameter values from a test case WorkItem.

Test execution failure error:
The unit test adapter failed to connect to the data source or to read the data. For more information on troubleshooting this error, see "Troubleshooting Data-Driven Unit Tests" (http://go.microsoft.com/fwlink/?LinkId=62412) in the MSDN Library.
Error details: Could not load file or assembly 'Microsoft.TeamFoundation.TestManagement.Controller, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

To resolve the error above, follow the steps:

Add a runsettings file in the test project.

Append the text below in the runsettings file:
<RunSettings>

<MSTest>

<ForcedLegacyMode>true</ForcedLegacyMode>

</MSTest>

</RunSettings>

Select the runsettings file and then execute the test case.

In case you are running the test on a test agent machine as a part TFS build, you need Visual Studio 2015 on the test agent machine.
Also, configure the runsettings file with the ForcedLegacyMode tag in the test execution step.

Content: Sinjith Haridasan Reeja
Review: Deepak Mittal