Hi I have a problem with tweetsharp sdk. I try to read tweets with the code below, sometimes not always I take this exception: "Arithmetic operation resulted in an overflow". I searched but coludn't find the reason?
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
With the default setting, C# compiler will not throw an exception if arithmetic overflow happens. The above program will not throw an exception and work fine because C# compiler is configured in that way.
If you want to ensure that arithmetic operations will throw overflow exceptions if an overflow happens, you need to use the checked { ... } code block. When using the checked { ... } code block, if any arithmetic operation causes an overflow, an OverflowException will be thrown, and will need to be catched and handled.
As an alternative to building the source (which can be tricky due to Windows Phone SDK dependencies etc.) you could give this fork a try:
https://github.com/timothy-makarov/tweetsharp
It's an unofficial bug fork for TweetSharp wrapped in a NuGet package:
http://www.nuget.org/packages/TweetSharp-Unofficial/
We came from TweetSharp v2.3.0, and updating to TweetSharp v2.3.1 did not solve our JSON deserialize problems. Replacing it with the unofficial v.2.3.1.2 package did though.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With