我正在将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的其中之一? –