我正在使用最新版本的 TweetSharp 来加载用户的个人资料。首先,我使用ListFollowerIdsFor
方法加载用户的所有关注者。之后,我将所有 id 划分为最多 100 个 id 的列表。
var ids = newUsersIds.Skip(i * 100).Take(100).Distinct().ToList(); var users = service.ListUserProfilesFor(new ListUserProfilesForOptions { UserId = ids });
有时我会StackoverflowException
搭上这条线。调用堆栈中的最后两行:
The thread '<No Name>' (0x17a0) has exited with code 0 (0x0).
A first chance exception of type 'System.Net.WebException' occurred in System.dll
递归
TweetSharp.dll!TweetSharp.JsonSerializer.DeserializeContent(string content, System.Type type) Line 168 + 0x1b bytes C#
TweetSharp.dll!TweetSharp.JsonSerializer.DeserializeSingle(string content, System.Type type) Line 223 + 0x11 bytes C#
TweetSharp.dll!TweetSharp.JsonSerializer.DeserializeJson(string content, System.Type type) Line 41 + 0xe bytes C#
我该如何预防?