我正在將Google Cloud PubSub集成到我的c#項目中,我使用NuGet安裝1.0.0-beta11,完全沒有任何錯誤。當我跑我的項目,當它到達使用發佈訂閱的代碼,我得到以下錯誤:無法在c#中運行Google Cloud PubSub,DLL問題
An unhandled exception of type 'System.IO.FileLoadException' occurred in
Google.Api.Gax.dll
Additional information: Could not load file or assembly 'Google.Apis.Auth, Version=1.21.0.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
的NuGet沒有安裝所有的依賴關係,包括Google.Apis.Auth.dll,但它是1.27.1。我嘗試了所有我能想到的,包括抓取該DLL的1.21.0並使用它,但沒有成功。我已經能夠運行.net sample就好,沒有錯誤。
有什麼想法?讓我知道你是否需要更多信息
它不應該嘗試加載Google.Apis.Auth 1.21.0 ...這是一個非常奇怪的版本,它依賴於它。你能告訴我們更多關於項目類型(目標框架等)嗎?你是否能夠通過一個小項目來重現這一點,這些項目除了(比如說)列表主題之外基本上什麼也不做?你能否檢查哪個版本的Google.Api.Gax.dll實際上已經部署? –
@JonSkeet目標框架是4.5,我正在編譯到一個類庫。一切似乎都從nuget下載正確的依賴關係(Google.Api.Gax.dll是v2.0.0)。我還沒有能夠重現一個小項目。項目引用,app.config和packages.config都顯示Google.Apis.Auth.dll爲1.27.1。我不知道1.21.0是從哪裏來的... – Hammy
你有什麼其他的依賴關係?也許是引入1.21.0的其中之一? –