2013-10-29 142 views
4

嗨我有一个tweetsharp sdk的问题。我尝试使用下面的代码阅读推文,有时候我并不总是这样做:“算术运算导致溢出”。我搜查,但coludn't找到原因?算术运算导致溢出excepiton在tweetsharp

TweetSharp.TwitterService tester = new TwitterService(); 

tester.AuthenticateWith(consumerkey, consumersecret, accesstoken, accesstokensecret); 

var a = tester.Search(new SearchOptions { Q = "screenname", Count = 100}); //On this line i take the excepiton 
+1

我不认为你已经张贴足以让我们来帮助你。例如,你的堆栈跟踪是什么样的?另外,在哪里执行数学运算,可能会导致您看到的异常类型? – Brian

回答

0

今天有同样的问题。他们的github上的issue可能与此有关。似乎已经有一个承诺来解决这个问题:link,但nuget的最新更新仍然是从2013年6月22日星期六开始的。

我不知道Nuget上的版本是否会更新为版本2.3。 1是开发者最后更新。

使用源而不是通过nuget安装TweetSharp应该解决问题,但我不知道这应该如何完成。

0

任何人都以与user2933990相同的问题到达此处。以下是正确的修复方法,前提是您已添加OAuthTwitterWrapper源代码(并编译)而不是dll本身。

在 “JsonTypes” 目录下,修改下列文件:

User.cs

原始

[JsonProperty("id")] 
public int Id { get; set; } 

更改为

[JsonProperty("id")] 
public long Id { get; set; } 

Hashtag.cs

原始

[JsonProperty("indices")] 
public List<int> Indices { get; set; } 

更改为

[JsonProperty("indices")] 
public List<long> Indices { get; set; } 
相关问题