This project has moved and is read-only. For the latest updates, please go here.

Windows phone 8 Account query asynchronously with version 2.1

Jan 3, 2014 at 12:02 AM

I'm using LINQtoTwitter version 2.1.11 to develop a twitter application for windows 8. I need to write an async function to return twitter name. I used following code with single user authentication
        public async Task<string> LoadProfileAsync()
            // configure the OAuth object
            var auth = new SingleUserAuthorizer
                Credentials = new SingleUserInMemoryCredentials()
                    ConsumerKey = CONSUMER_KEY,
                    ConsumerSecret = CONSUMER_SECRET,
                    TwitterAccessToken = TwitterAcceccToken,
                    TwitterAccessTokenSecret = TwitterAccessTokenSecret

            var tcp = new TaskCompletionSource<Profile>();

            using (var twitterCtx = new TwitterContext(auth))
                (from account in twitterCtx.Account
                    where account.Type == AccountType.VerifyCredentials && account.SkipStatus == true
                 select account).MaterializedAsyncCallback(resp =>
                        if (resp.Status != TwitterErrorStatus.Success || resp.State.Count() != 1)

                            tcp.SetException(new Exception());

                        var profile = resp.State.First().User.Name;

                return await tcp.Task;
But I'm getting an exception "The remote server returned an error: NotFound" . In other thread ( you've mention that if you don't set search parameter you would get Not Found error.

Would you please help me regarding this issue?

Jan 3, 2014 at 7:12 AM

In this case the Not Found might mean that Twitter didn't recognize the tokens. Double check the token values to make sure you have them in the right order and haven't accidentally added a space or truncated a character.

I've also seen a Not Found when Fiddler is running, but not configured properly.

Jan 3, 2014 at 11:58 PM
Thanks @JoeMayo

No problem in token neither fiddler was running.
I ended up using version 3. It works fine.
Another question. I didn't find version 3 source code. Just in case I want to send pull request because I know this is in pre-release