I have added the latest version (14.102.0) of Microsoft.TeamFoundationServer.ExtendedClient through NuGet Package Manager to the project and connecting TFS to use data in Coded UI testing. Whenever I debug a solution "Unable to load DLL 'Microsoft.WITDataStore32.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)" is thrown at line
var tfsConnectedTeamProject = iTestManagementService.GetTeamProject("TfsProjectName");
Please note that his happens only when i debug the test, without debugging I could able to run Coded UI test without any issues also as a work around we have copied solution from my machine to different machine, debugging just works fine and it didn't thrown any error. I have seen few workarounds like copying native dll's to bin folder which didn't worked. Please refer below for full exception message.
Result StackTrace:
at Microsoft.TeamFoundation.WorkItemTracking.Client.DataStore.DataStoreNative32.CreateDatastore(IntPtr& handle)
at Microsoft.TeamFoundation.WorkItemTracking.Client.DataStore.DataStoreNative.CreateDatastore(IntPtr& handle)
at Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore.InitializeInternal()
at Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore.Microsoft.TeamFoundation.Client.ITfsTeamProjectCollectionObject.Initialize(TfsTeamProjectCollection teamProjectCollection)
at Microsoft.TeamFoundation.Client.TfsTeamProjectCollection.InitializeTeamFoundationObject(String fullName, Object instance)
at Microsoft.TeamFoundation.Client.TfsConnection.CreateServiceInstance(Assembly assembly, String fullName)
at Microsoft.TeamFoundation.Client.TfsConnection.GetServiceInstance(Type serviceType, Object serviceInstance)
at Microsoft.TeamFoundation.Client.TfsTeamProjectCollection.GetServiceInstance(Type serviceType, Object serviceInstance)
at Microsoft.TeamFoundation.Client.TfsConnection.GetService(Type serviceType)
at Microsoft.TeamFoundation.TestManagement.Client.TestManagementTeamProject.GetWitProject()
at Microsoft.TeamFoundation.TestManagement.Client.TestManagementTeamProject.get_WitHelper()
at Microsoft.TeamFoundation.TestManagement.Client.TestManagementTeamProject.get_SharedParameterDataSetWorkItemTypeName()
at Microsoft.TeamFoundation.TestManagement.Client.TestManagementTeamProject.get_HasSupportForSharedParameterDataSets()
at Microsoft.TeamFoundation.TestManagement.Client.TestManagementTeamProject..ctor(TestManagementService manager, String projectName)
at Microsoft.TeamFoundation.TestManagement.Client.TestManagementService.<GetTeamProject>b__0_0(String name)
at Microsoft.TeamFoundation.TestManagement.Client.ObjectCache`2.Get(Key key, Creator creator)
at Microsoft.TeamFoundation.TestManagement.Client.TestManagementService.GetTeamProject(String projectName)
at Sample.DataSource.TFSConnection.MapTestCaseParameters(Int32 testCaseId) in C:\SampleAutomation\Sample\Main\Src\Automation\TestAutomation\TestAutomation\DataSource\TFSConnection.cs:line 17
at Sample.DriverFunctions.SystemAdmin.CreateUser_Run() in C:\SampleAutomation\Sample\Main\Src\Automation\TestAutomation\TestAutomation\DriverFunctions\SystemAdmin.cs:line 329
Result Message:
Test method Sample.DriverFunctions.SystemAdmin.CreateUser_Run threw exception:
System.DllNotFoundException: Unable to load DLL 'Microsoft.WITDataStore32.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Manoj Kumar M