2016-11-14 118 views
0

当我执行我的应用程序一切运作良好,直到它尝试执行行:无法加载DLL“Microsoft.WITDataStore64.dll”在我的Azure的WorkerRole项目

teamProjectCollection.GetService<WorkItemStore>(); 

它与错误打破:

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)

我知道作为计算器问题here和微软响应here看到,这是记录在案的,但我不知道如何真正实现修复!

微软回应说:

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

我在文件管理也看到,我可以在路径中找到Microsoft.WITDataStore64.dll:

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

除了当我浏览到我的应用程序的bin文件夹,我已经在那里看到.dll了!

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

因此,现在我难以理解我实际上应该采取什么行动来解决这个问题。有任何想法吗?

+0

您的工作者角色有多少个实例?是否所有的实例都有WITDataStore64.dll?如果你偏离了其中一个实例并将dll复制到它中,这还不够。对于Azure工作者角色,请尝试通过启动任务将此dll复制到bin文件夹,以确保所有实例都具有此dll。有关启动任务的更多信息,请参阅[本文](https://azure.microsoft.com/en-us/documentation/articles/cloud-services-startup-tasks/) –

回答

0

你可以试试下面的解决方案吗?

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)

0

关闭在Visual Studio解决方案,以避免编辑冲突。然后将以下添加到您的<ItemGroup>元素之一,在您的Project.csproj文件:

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

您可能需要搜索包含Microsoft.WITDataStore64.dll文件的确切文件夹,并纠正上述从那里微软安装了它在我的系统规范。此外,我显示的64位DLL,你可能需要[有条件地]指定32位DLL。

重新载入您的项目并构建。它应该将Microsoft.WITDataStore64.dll复制到您的项目输出目录。 (我不是Azure的专家,但期望发布到Azure也会为您推送dll。)