當我執行我的應用程序一切運作良好,直到它嘗試執行行:無法加載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?!
因此,現在我難以理解我實際上應該採取什麼行動來解決這個問題。有任何想法嗎?
您的工作者角色有多少個實例?是否所有的實例都有WITDataStore64.dll?如果你偏離了其中一個實例並將dll複製到它中,這還不夠。對於Azure工作者角色,請嘗試通過啓動任務將此dll複製到bin文件夾,以確保所有實例都具有此dll。有關啓動任務的更多信息,請參閱[本文](https://azure.microsoft.com/en-us/documentation/articles/cloud-services-startup-tasks/) –