Error when searching for users on Windows Phone 8.1 using linqtotwitter

1

I'm developing a Windows Phone 8.1 app and when I try to search for users using linqtotwitter, I get this error: "The application called an interface that was marshalled for a different thread. (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD))"

This is my code:

var users = new List<UserItem>();

                var foundUsers =
                    await
                        (from user in twitterCtx.User
                            where user.Type == UserType.Search &&
                                  user.Query == SearchBox.Text
                            select user)
                            .ToListAsync();

                foreach (var foundUser in foundUsers)
                {
                    var user = new UserItem();
                    user.Id = Convert.ToUInt64(foundUser.UserIDResponse);
                    user.ProfileImageSource = foundUser.ProfileImageUrl.Replace("_normal", "");
                    user.ScreenName = foundUser.ScreenNameResponse;
                    user.UserName = foundUser.Name;
                    users.Add(user);
                }
                ListPeople.ItemsSource = users;

I get the same error when trying to show statuses from a list. I also tried to insert a dispatcher but I got the same error.

c#
windows-phone-8.1
linq-to-twitter
asked on Stack Overflow Dec 19, 2014 by Alessandro S. • edited Dec 20, 2014 by Alessandro S.

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0