算术运算导致tweetsharp溢出

时间:2013-10-29 21:33:13

标签: c# twitter

您好tweetsharp sdk有问题。我尝试使用下面的代码阅读推文,有时并不总是我接受这个例外:“算术运算导致溢出”。我搜索了但是没有找到原因?

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

3 个答案:

答案 0 :(得分:8)

作为构建源代码的替代方法(由于Windows Phone SDK依赖性等原因,这可能很棘手),您可以尝试使用此分支:
https://github.com/timothy-makarov/tweetsharp

这是一个包含在NuGet包中的TweetSharp的非官方bug分支:
http://www.nuget.org/packages/TweetSharp-Unofficial/

我们来自TweetSharp v2.3.0,更新到TweetSharp v2.3.1并没有解决我们的JSON反序列化问题。尽管如此,用非官方的v.2.3.1.2包替换它。

答案 1 :(得分:0)

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

我不知道Nuget上的版本是否会更新,因为版本2.3.1是开发人员上次更新。

使用源而不是通过nuget安装TweetSharp应该可以解决问题,但我不知道应该怎么做。

答案 2 :(得分: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; }