twitterizer API 值不能为空。参数名称:字符串 ASP.NET
我正在使用 Twitterizer API 来访问 twitter 相关功能。我有一个演示应用程序,可以与我的consumerkey 和consumerssecret 一起正常工作,我在本地运行该应用程序。但是当我在实时应用程序中集成相同的设置时,我收到此错误
值不能为空。参数名称:字符串
谁能告诉我为什么?
谢谢
I am using Twitterizer API for accessing twitter related functionality. I have one demo application that works fine with my consumerkey and consumersecret i run this application locally. but when i integrate the same settings in my live application i got this error
Value cannot be null.Parameter name: String
Can anyone tell me why?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请检查你的钥匙。另请检查您的服务器时间。有时我们生成的时间戳会带来一些问题。
Please check you keys. Also check your server time. Sometimes timestamp that we generate give some issues.
如果没有堆栈跟踪或更多详细信息,我绝对无法给您绝对准确的答案。
我最好的猜测是您的请求失败,可能是因为 DNS、缺乏 .NET 权限或服务器上的代理设置配置错误,并且您在尝试使用 ResponseObject 之前没有检查它是否为空。
要在运行时检查失败的请求(这样您就可以显示一个不错的错误,而无需丑陋的 try/catch),请检查您返回的
TwitterResponse
的Result
属性从图书馆。例如,
该代码直接从我的主页中提取。
Without a stacktrace or more details, there is absolutely no way I could give you an absolutely accurate answer.
My best guess is that your request is failing, possibly because of DNS, lack of .NET permissions, or misconfigured proxy settings on the server and you're not checking if the ResponseObject is null before trying to use it.
To check for failed requests at runtime (so you can display a nice error without an ugly try/catch), check the
Result
property of theTwitterResponse<T>
you got back from the library.For example,
That code is lifted directly from my homepage.