开发者

Why is GetRequestToken not working?

I have the following little snippet that won't compile:

using TweetSharp.Twitter.Fluent;

//...

var twitter = FluentTwitter.CreateRequest();
twitter.Authentication.GetRequestToken("...", "...");

...and it gives me the following error:

Main.cs(12,12): Error CS1061: Type `Twe开发者_Python百科etSharp.Twitter.Fluent.
IFluentTwitterAuthentication' does not contain a definition for `GetRequestToken'
and no extension method `GetRequestToken' of type TweetSharp.Twitter.Fluent.
IFluentTwitterAuthentication' could be found (are you missing a using directive
or an assembly reference?) (CS1061) (StackBot)

Which is strange because according to TweetSharp's website, that's supposed to be valid code.

Am I forgetting something or is there some other assembly I need to reference?

I'm using Mono 2.4 on Ubuntu 10.10 64-bit.


I may have found a clue here. Using the assembly browser, I have discovered that IFluentTwitterAuthentication has the following definition:

public abstract interface IFluentTwitterAuthentication : IFluentAuthentication
{
    // Properties
    public abstract IFluentTwitter Root { get; }
}

...which leads me to believe that something is not quite right with the assembly.


Their code seems to be:

var twitter = FluentTwitter.CreateRequest ()
    .Authentication.GetRequestToken("...", "...");

which is quite different than yours:

var twitter = FluentTwitter.CreateRequest();
twitter.Authentication.GetRequestToken("...", "...");


Your USING statements may be missing...Try this:

using TweetSharp.Twitter.Fluent;
using TweetSharp.Twitter.Model;
using TweetSharp.Twitter.Extensions;


//...

var twitter = FluentTwitter.CreateRequest();
twitter.Authentication.GetRequestToken("...", "...");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜