views:

52

answers:

1

I'm attempting to create a web application with TweetSharp that will connect to Twitter with OAuth. So far I am able to pass the consumer key and consumer secret to Twitter, have the user allow my web app access, then come back to my app passing me the oauth_token. Once I get back I am attempting to authenticate to Twitter based on the example code in TweetSharp's Demo.OAuth.Web project here: http://tweetsharp.codeplex.com/SourceControl/changeset/view/10ab65e64a56#src%2fvs2010%2fDemo.OAuth.Web%2fDefault.aspx.cs

However, I'm getting the error: 'TweetSharp.Twitter.Model.TwitterResult' does not contain a definition for 'AsToken' and no extension method 'AsToken' accepting a first argument of type 'TweetSharp.Twitter.Model.TwitterResult' could be found (are you missing a using directive or an assembly reference?)

I'm getting it at this line:

var accessToken = FluentTwitter.CreateRequest()
                                            .Authentication
                                            .GetAccessToken(token)
                                            .Request().AsToken();

I've searched through the documentation and some of the source but I cannot find where this AsToken method is. Is there a using directive or reference that I am missing?

+4  A: 

It's in TweetSharp.Twitter.Extensions.TwitterExtensions (file TwitterExtensions.Model.cs). If you add

using TweetSharp.Twitter.Extensions;

the compiler should pick it up automatically.

Rup
That did it. Thank you.
Corey Sunwold