3

When I execute my application all works well until it tries to execute the line:

teamProjectCollection.GetService<WorkItemStore>();

where it breaks with the error:

An exception of type 'System.DllNotFoundException' occurred in Microsoft.TeamFoundation.WorkItemTracking.Client.dll but was not handled in user code

Additional information: Unable to load DLL 'Microsoft.WITDataStore64.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

I know this is documented as seen in the stackoverflow question here and the microsoft response here, but I don't know how to actually implement the fix!

The microsoft response says:

Microsoft.WITDataStore*.dll is part of the ExtendedClient package, they are native dlls and cannot be referenced in managed project. You will need to manually copy the dll into your bin folder for runtime resolution.

Microsoft.WITDataStore32.dll is in ..\Microsoft.TeamFoundationServer.ExtendedClient.14.83.1\lib\native\x86 Microsoft.WITDataStore64.dll is in ..\Microsoft.TeamFoundationServer.ExtendedClient.14.83.1\lib\native\amd64

And I do see in File Explorer that I can find Microsoft.WITDataStore64.dll in the path:

 C:\Users\<user>\.nuget\packages\Microsoft.TeamFoundationServer.ExtendedClient\14.102.0\lib\native\amd64

except when I navigate to my application's bin folder, I already see the .dll there!

WorkerProjectName\bin\Debug\Microsoft.WITDataStore64.dll  <-- already exists?!

So now I am stumped at what I am actually supposed to move to fix this issue. Any ideas?

Community
  • 1
  • 1
Pipeline
  • 1,029
  • 1
  • 17
  • 45
  • How many instance of your worker role? Does all instances have the WITDataStore64.dll? If you remote to one of the instance and copy the dll into it, it is not enough. For Azure worker role, please try to copy this dll to bin folder via startup task to ensure all instance have this dll. For more info about start up task, please refer to [this article](https://azure.microsoft.com/en-us/documentation/articles/cloud-services-startup-tasks/) – Jambor - MSFT Nov 15 '16 at 04:52

2 Answers2

1

Can you try below solution?

I found a feedback about your issue that someone submitted before. And is has closed, try the method in the link provided by Microsoft https://connect.microsoft.com/VisualStudio/Feedback/Details/1695433

Microsoft.WITDataStore*.dll is part of the ExtendedClient package, they are native dlls and cannot be referenced in managed project. You will need to manually copy the dll into your bin folder for runtime resolution.

Microsoft.WITDataStore32.dll is in ..\Microsoft.TeamFoundationServer.ExtendedClient.14.83.1\lib\native\x86 Microsoft.WITDataStore64.dll is in ..\Microsoft.TeamFoundationServer.ExtendedClient.14.83.1\lib\native\amd64

MSDN Forum: Unable to load DLL 'Microsoft.WITDataStore32.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

Salih KARAHAN
  • 299
  • 1
  • 4
  • 18
0

Close your solution in Visual Studio to avoid editing conflicts. Then add the following to one of your <ItemGroup> elements in your Project.csproj file:

<ItemGroup>
  <Content Include="$(DevEnvDir)CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Microsoft.WITDataSTore64.dll">
    <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
  </Content>

You might have to search for the exact folder that contains the Microsoft.WITDataStore64.dll file and correct the specification above from where Microsoft installed it on my system. Additionally, I show the 64bit dll, where you might need to [conditionally] specify the 32bit dll.

Reload your project and build. It should copy the Microsoft.WITDataStore64.dll to your project output directory. (I'm not an expert on Azure, but expect that publishing to Azure will also push the dll for you as well.)

ergohack
  • 1,268
  • 15
  • 27