Tag: 谷歌云,发布订阅

无法在c#中运行Google Cloud PubSub,DLL问题

我正在努力将Google Cloud PubSub集成到我的c#项目中,我使用NuGet安装1.0.0-beta11 ,完全没有错误。 当我运行我的项目,当它到达使用pubsub的代码时,我收到以下错误: 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示例 ,没有错误。 有什么想法吗? 如果您需要更多信息,请告诉我

Google API:Gmail服务推送通知(观察) – 未授权用户执行此操作

我想在邮箱上调用watch()。 我设置了一个服务Iam帐户,并创建了一个主题和suscription。 我向我的服务帐户授予了我的主题和订阅的完整(所有者)权限。 但是当在watch()上调用execute时,我收到错误: Google.Apis.Requests.RequestError Error sending test message to Cloud PubSub projects/projectid/topics/topicname : User not authorized to perform this action. [403] Errors [ Message[Error sending test message to Cloud PubSub projects/projectid/topics/topicname : User not authorized to perform this action.] Location[ – ] Reason[forbidden] Domain[global] ] 这是我用来设置服务的代码: credential = new X509Certificate2(“file.p12”), “password”, X509KeyStorageFlags.Exportable); var service […]