C# TweetSharp错误无法反序列化当前JSON数组

C# TweetSharp错误无法反序列化当前JSON数组,c#,asp.net,json,twitter,C#,Asp.net,Json,Twitter,我正在开发一个旧的应用程序,它使用TweetSharp在网站上列出推文,但最近我开始收到以下错误,经过几个小时的尝试,我无法找出原因 我有以下代码 //get the twitter username TwitterUsername = SpotlightPage.Property["TwitterUsername"].ToString(); //load tweets from the cache var tweets = C

我正在开发一个旧的应用程序,它使用TweetSharp在网站上列出推文,但最近我开始收到以下错误,经过几个小时的尝试,我无法找出原因

我有以下代码

        //get the twitter username
        TwitterUsername = SpotlightPage.Property["TwitterUsername"].ToString();

        //load tweets from the cache
        var tweets = Context.Cache["TwitterSpotlight" + TwitterUsername] as IEnumerable<TwitterStatus>;

        //If the cache doesn't exist or has expired, get the list of tweets again and set the cache
        if (tweets == null)
        {
            var service = new TwitterService(_consumerKey, _consumerSecret);
            service.AuthenticateWith(_accessToken, _accessTokenSecret);

            //set options for listing tweets
            var options = new ListTweetsOnUserTimelineOptions();

            //set the screen name to be the username
            options.ScreenName = TwitterUsername;

            // The number of tweets to display
            options.Count = 6;

            //Get the list of tweets.
            tweets = service.ListTweetsOnUserTimeline(options);

            //only if we got tweets add them to the cache
            if (tweets != null)
            {
                    //Cache the output of the tweets
                    Context.Cache.Add("TwitterSpotlight" + TwitterUsername, tweets, null, DateTime.Now.AddMinutes(5), TimeSpan.Zero, System.Web.Caching.CacheItemPriority.Normal, null);
            }
        }

        tweetdisplay.DataSource = tweets;
        tweetdisplay.DataBind();
//获取twitter用户名
TwitterUsername=SpotlightPage.Property[“TwitterUsername”].ToString();
//从缓存加载推文
var tweets=Context.Cache[“TwitterSpotlight”+TwitterUsername]作为IEnumerable;
//如果缓存不存在或已过期,请再次获取tweet列表并设置缓存
如果(tweets==null)
{
var服务=新推特服务(_consumerKey,_ConsumerCret);
使用(\u accessToken,\u accessTokenSecret)进行身份验证;
//设置列出推文的选项
var options=new ListTweetsOnUserTimelineOptions();
//将屏幕名称设置为用户名
options.ScreenName=推特用户名;
//要显示的推文数
选项。计数=6;
//获取推文列表。
tweets=service.ListTweetsOnUserTimeline(选项);
//只有当我们收到推文时,才能将它们添加到缓存中
if(tweets!=null)
{
//缓存推文的输出
Context.Cache.Add(“TwitterSpotlight”+TwitterUsername,tweets,null,DateTime.Now.AddMinutes(5),TimeSpan.Zero,System.Web.Caching.CacheItemPriority.Normal,null);
}
}
tweetdisplay.DataSource=tweets;
tweetdisplay.DataBind();
如果我将tweet的计数设置为>5,那么我将收到上图中描述的JSON错误。这表明第6条推文中的数据可能有问题,但我看不到任何可能导致问题的东西。我读过其他帖子,认为表情符号/笑脸符号可能会导致这种行为,最糟糕的修复方法是删除推文。我只是不能删除推文,需要确保这是稳定的

我想知道是否有人解决了这个问题


提前感谢

您可以演示如何反序列化吗?显示这个json有问题吗?我没有访问该代码的权限抱歉,我不知道它怎么能起作用而不起作用understand@Paul表情符号也会出现同样的错误。你有没有解决过这个问题?@randomman-我们从来没有时间解决这个问题。抱歉,我们只是排除了显示转发的内容,如果在推特中使用表情符号,那么我们会发现错误,而不是YSOD。祝你好运