(Simple) problem with TweetSharp

白昼怎懂夜的黑 提交于 2019-12-13 02:54:42

问题


Here is what I did :
1. I create a C# project from VS .NET 2005 (Console application)
2. Attached the library from tweetsharp.com
3. I copied and pasted and tried to run

The code

//setting up a request is unchanged
var twitter = FluentTwitter.CreateRequest()
.AuthenticateAs(user, password)
.Statuses().OnHomeTimeline().AsXml();

// In past releases 'response' used to be a string, now it's a TwitterResult object
var response = twitter.Request();

I can't get it running. The error is :

'Dimebrain.TweetSharp.Fluent.IFluentTwitter' does not contain a definition for    'AuthenticateAs'... Data\Temporary Projects\ConsoleApplication1\Program.cs    

Any ideas what I did wrong?


回答1:


The only 'using' directive you need for that code snippet should be:

using Dimebrain.TweetSharp.Fluent

You'll probably also eventually need:

using Dimebrain.TweetSharp.Extensions;
using Dimebrain.TweetSharp.Model;

...so you might as well add those too.

We do plan to collapse a lot of TweetSharp into a single namespace at some point, but for now that should get you most of what you need.




回答2:


You need to make sure you are referencing the right namespaces in your code - I think in this case Dimebrain.TweetSharp.Extensions.

There's a more thorough snippet here on the TweetSharp site.



来源:https://stackoverflow.com/questions/1824723/simple-problem-with-tweetsharp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!