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?
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
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.)
User contributions licensed under CC BY-SA 3.0