2016-11-14 106 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。)