无法加载 DLL 'Microsoft.WITDataStore32.dll' (TeamFoundation.WorkItemTracking)

Unable to load DLL 'Microsoft.WITDataStore32.dll' (TeamFoundation.WorkItemTracking)

我发布这个是希望它能节省其他人解决这个问题的时间和精力:

我当前的设置是 VS2015TFS 2013.4

问题

我的旧 PC 安装有 VS2013,我一直在使用 Microsoft.TeamFoundation.WorkItemTracking.Client 命名空间从 TFS 获取一些工作项信息。

我最近不得不重建我的 PC,并继续开发获取这些信息的程序。

令我沮丧的是,我一直收到错误消息:

Unable to load DLL 'Microsoft.WITDataStore32.dll'

最后,以下 Whosebug 线程给了我答案:

where is the tfs 2010 api dll microsoft teamfoundation framework server dll

what do i need to install to get microsoft teamfoundation workitemtracking client

VS2015 dll 与 TFS 2013 不兼容,所以不要Microsoft Visual Studio 14.0\ Common7 \ IDE寻找dll!

如果您使用 TFS 2013

,则必须安装 Team Explorer 2013

它很小(只有 130 MB),并且包含正确的 DLL。

安装后需要Browse...参考这里:

C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\ReferenceAssemblies

您不再需要安装 TFS 对象 model/Team 资源管理器。您可以使用 NuGet package

还有 NuGet 包,您可能 运行 遇到您的应用程序无法找到本机 DLL 的问题。

以下文字复制自 https://connect.microsoft.com/VisualStudio/feedback/details/1695433/team-foundation-server-2015-sdk-missing-microsoft-witdatastore64-dll

Microsoft.WITDataStore*.dll 是 ExtendedClient 包的一部分,它们是本机 dll,不能在托管项目中引用。 您需要手动将 dll 复制到您的 bin 文件夹中以获得 运行 时间分辨率。

Microsoft.WITDataStore32.dll 位于 ..\Microsoft.TeamFoundationServer.ExtendedClient.14.83.1\lib\native\x86 Microsoft.WITDataStore64.dll 在..\Microsoft.TeamFoundationServer.ExtendedClient.14.83.1\lib\native\amd64

(注意这些路径指向 NuGet 包文件夹)

如果您在处理 TFS/VSTS 时遇到 Microsoft.WITDataStore32.dll 问题,即。在 Visual Studio 2015 中获取项目名称或获取测试用例 ID,然后您可以简单地将 Team Foundation dll 从 14.0.0.0 重定向到版本 12.0.0.0,因为 14 版本的 dll 在检索此类数据时会产生问题,而我们常常会遇到此类错误.

我遇到问题 "Unable to load DLL 'Microsoft.WITDataStore32.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)" 而 运行 我的编码 UI 测试脚本分别从 "TFS 2012 and VS2013" 迁移到 "VSTS and VS2015" 后。

当我在应用程序配置中将引用的 14 版本 dll 重定向到 12 版本时,问题得到解决,如下所示:

   <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

     <dependentAssembly>
       <assemblyIdentity name="Microsoft.TeamFoundation.Common" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
       <bindingRedirect oldVersion="14.0.0.0" newVersion="12.0.0.0"/>
     </dependentAssembly>

     <dependentAssembly>
       <assemblyIdentity name="Microsoft.TeamFoundation.TestManagement.Client" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
       <bindingRedirect oldVersion="14.0.0.0" newVersion="12.0.0.0"/>
     </dependentAssembly>

     <dependentAssembly>
       <assemblyIdentity name="Microsoft.TeamFoundation.WorkItemTracking.Client" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
       <bindingRedirect oldVersion="14.0.0.0" newVersion="12.0.0.0"/>
     </dependentAssembly>

   </assemblyBinding>

此致, 普拉西德

我的情况是我需要在测试项目中直接添加NuGet引用(我的自定义属性位于另一个项目中,dll 没有复制到测试项目中)。

我正在发布此信息 w.r.t。 Visual Studio 2017 年以防对某人有帮助:

Please check whether you have 'Microsoft.WITDataStore32.dll' in the path below:

C:\Program Files (x86)\Microsoft Visual Studio17\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer

If not, please try to install team explorer for vs 2017 , download it from this blog:

https://blogs.msdn.microsoft.com/bharry/2017/04/05/team-explorer-for-tfs-2017/

Then find Microsoft.WITDataStore32.dll in team explorer folders and copy it to the path above.

来源:MSDN