首页 文章

Twitterizer TwittterTimeline NewtonSoft.JSON.JsonSerializationException问题

提问于
浏览
4

以下代码抛出NewtonSoft.JSON.JsonSerializationException {“反序列化对象时的意外标记:StartObject . 第1行,位置1884.”}

Twitterizer版本:2.4.0.26532 NewtonSoft.Json = 4.0.7.0(使用Visual Studio中的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();
        }
    }

堆栈跟踪:

在U:\ Development \ Releases \ Json \ Working \ Src \ Newtonsoft.Json \ Serialization \ JsonSerializerInternalReader.cs:line 1238中的Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject,JsonReader reader,JsonObjectContract contract,String id)在Newtonsoft.Json中的Newtonoft.Json.Serialization.JsonSerializerInternalReader.CreateAndPopulateObject(JsonReader reader,JsonObjectContract contract,String id)d:\ Development \ Releases \ Json \ Working \ Src \ Newtonsoft.Json \ Serialization \ JsonSerializerInternalReader.cs:Newtonsoft.Json的第956行.serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader,Type objectType,JsonContract contract,JsonProperty member,Object existingValue)位于d:\ Development \ Releases \ Json \ Working \ Src \ Newtonsoft.Json \ Serialization \ JsonSerializerInternalReader.cs:第433行,位于Newtonsoft .Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader,Type objectType,JsonContract contract,JsonProperty member,Object existsin gValue)在d:\ Development \ Releases \ Json \ Working \ Src \ Newtonsoft.Json \ Serialization \ JsonSerializerInternalReader.cs:第236行,位于Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueNonProperty(JsonReader reader,Type objectType,JsonContract contract,JsonConverter converter) )在D:\ Development \ Releases \ Json \ Working \ Src \ Newtonsoft.Json \ Serialization \ JsonSerializerInternalReader.cs:第221行,位于Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IWrappedCollection wrappedList,JsonReader reader,String reference,JsonArrayContract contract)在d:\ Development \ Releases \ Json \ Working \ Src \ Newtonsoft.Json \ Serialization \ JsonSerializerInternalReader.cs:第794行,位于Newtonsoft.Json.Serialization.JsonSerializerInternalReader . <> c_DisplayClass1 . <CreateAndPopulateList> b_0(IList l,Boolean isTemporaryListReference)在d:\ Development \ Releases \ Json \ Working \ Src \ Newtonsoft.Json \ Serialization \ JsonSerializerInternalReader.cs:Newtonsoft.Json.Utilities.CollectionUt第744行ils.CreateAndPopulateList(Type listType,Action2 populateList)位于d:\ Development \ Releases \ Json \ Working \ Src \ Newtonsoft.Json \ Utilities \ CollectionUtils.cs:第233行,位于Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateAndPopulateList(JsonReader阅读器,字符串引用,JsonArrayContract Contract )在d:\ Development \ Releases \ Json \ Working \ Src \ Newtonsoft.Json \ Serialization \ JsonSerializerInternalReader.cs:第732行,位于Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader,Type objectType,JsonContract) d:\ Development \ Releases \ Json \ Working \ Src \ Newtonsoft.Json \ Serialization \ JsonSerializerInternalReader.cs中的contract,JsonProperty成员,Object existingValue,String reference):Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader)中的第495行,在D:\ Development \ Releases \ Json \ Working \ Src \ Newtonsoft.Json \ Serialization \ JsonSeria中键入objectType,JsonContract合约,JsonProperty成员,Object existingValue) lizerInternalReader.cs:位于d:\ Development \ Releases \ Json \ Working \ Src \ Newtonsoft.Json \ Serialization \ JsonSerializerInternalReader中的Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueNonProperty(JsonReader reader,Type objectType,JsonContract contract,JsonConverter converter)的第238行.cs:Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader,Type objectType)中的第221行,位于d:\ Development \ Releases \ Json \ Working \ Src \ Newtonsoft.Json \ Serialization \ JsonSerializerInternalReader.cs:Newtonsoft的第117行.Json.JsonSerializer.DeserializeInternal(JsonReader reader,Type objectType)位于d:\ Development \ Releases \ Json \ Working \ Src \ Newtonsoft.Json \ JsonSerializer.cs:第421行,位于Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader,Type在d:\ Development \ Releases \ Json \ Working \ Src \ Newtonsoft.Json \ JsonSerializer.cs中的objectType):在dtons中的Newtonsoft.Json.JsonConvert.DeserializeObject(String value,Type type,JsonSerializerSettings settings)中的第413行开发\发布\ Json \ Working \ Src \ Newtonsoft.Json \ JsonConvert.cs:第7行,位于d:\ Development \ Releases \ Json \ Working \中的Newtonsoft.Json.JsonConvert.DeserializeObject [T](字符串值,JsonSerializerSettings设置) Src \ Newtonsoft.Json \ JsonConvert.cs:在D:\ Development \ Releases \ Json \ Working \ Src \ Newtonsoft.Json \ JsonConvert.cs中的Newtonsoft.Json.JsonConvert.DeserializeObject [T](字符串值)中的第694行:行651在Twitterizer.Core.SerializationHelper1.Deserialize(Byte [] webResponseData,DeserializationHandler deserializationHandler)at at位于Twitterizer.TwitterTimeline.UserTimeline(UserTimelineOptions选项)的Twitterizer.TwitterTimeline.UserTimeline(OAuthTokens标记,UserTimelineOptions选项)上的Twitterizer.Core.TwitterCommand1.PerformAction [T](ICommand1命令)上的Twitterizer.Core.TwitterCommand1.ExecuteCommand()

1 回答

  • 3

    感谢您发布此内容 . 我将不得不看看它,并弄清楚新版本的json.net改变了什么 .

    对于后代,here is the forums topic你也在那里报告了那里的bug .

相关问题