次のコードは、NewtonSoft.JSON.JsonSerializationException {"オブジェクトを逆シリアル化するときに予期しないトークン: StartObject. Line 1, position 1884."} をスローします。
Twitterizer バージョン:2.4.0.26532 NewtonSoft.Json = 4.0.7.0 (ビジュアル スタジオで Nu-GET アドインを使用してインストール)
不足している、または取得できないものはありますか?
class Program
{
static void Main(string[] _args)
{
Logger.Write("Calling Twitter", Constants.TWITTER_AGREGATOR_LOG_CATEGORY);
UserTimelineOptions options = new UserTimelineOptions();
options.ScreenName = "as_tuce2";
TwitterResponse<TwitterStatusCollection> tweets = TwitterTimeline.UserTimeline(options); //throws exception
OAuthTokens tokens = new OAuthTokens();
tokens.AccessToken = // removed...
tokens.AccessTokenSecret = // removed...
tokens.ConsumerKey = // removed...
tokens.ConsumerSecret = // removed...
UserTimelineOptions userOptions = new UserTimelineOptions();
userOptions.IncludeRetweets = false;
userOptions.ScreenName = "as_tuce2";
userOptions.UseSSL = true;
userOptions.Count = 20;
TwitterResponse<TwitterUser> showUserResponse = TwitterUser.Show(tokens, "as_tuce2"); //ok
TwitterResponse<TwitterStatusCollection> timelineResponse = TwitterTimeline.UserTimeline(tokens); //throws exception
Console.ReadLine();
}
}
スタックトレース:
d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 1238 の Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject (オブジェクト newObject、JsonReader リーダー、JsonObjectContract コントラクト、文字列 ID) でd:\Development\Releases\Json\Working\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:Newtonsoft.Json の行 956 の Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateAndPopulateObject(JsonReader リーダー、JsonObjectContract コントラクト、文字列 ID)。 Newtonsoft の d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 433 の Serialization.JsonSerializerInternalReader.CreateObject(JsonReader リーダー、Type objectType、JsonContract コントラクト、JsonProperty メンバー、Object existingValue)。ジョンソン。Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue) in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:Newtonsoft の 236 行目。 d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs: Newtonsoft.Json の 221 行目の Json.Serialization.JsonSerializerInternalReader.CreateValueNonProperty (JsonReader リーダー、Type objectType、JsonContract コントラクト、JsonConverter コンバーター) d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:Newtonsoft.Json.Serialization.JsonSerializerInternalReader.<>c_ の 794 行目DisplayClass1.<CreateAndPopulateList>b _0(IList l, Boolean isTemporaryListReference) in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs: Newtonsoft.Json.Utilities.CollectionUtils.CreateAndPopulateList の 744 行目
2 populateList) in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\Utilities\CollectionUtils.cs:line 233 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateAndPopulateList(JsonReader reader, String reference, JsonArrayContract contract) in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 732 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String reference) in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 495 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue) in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 238 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueNonProperty(JsonReader reader, Type objectType, JsonContract contract, JsonConverter converter) in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 221 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType) in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 117 at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType) in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\JsonSerializer.cs:line 421 at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType) in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\JsonSerializer.cs:line 413 at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings) in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\JsonConvert.cs:line 732 at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings) in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\JsonConvert.cs:line 694 at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value) in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\JsonConvert.cs:line 651 at Twitterizer.Core.SerializationHelper
Twitterizer.TwitterTimeline.UserTimeline ( OAuthTokens1.ExecuteCommand() at Twitterizer.Core.CommandPerformer.PerformAction[T](ICommand
トークン、UserTimelineOptions オプション) で Twitterizer.TwitterTimeline.UserTimeline(UserTimelineOptions オプション)