Quantcast
Channel: Tweetinvi a friendly Twitter C# library
Viewing all articles
Browse latest Browse all 4126

Commented Unassigned: NullReferenceException with User.GetLoggedUser().GetFriends() [2303]

$
0
0
Hello,

I'm trying for the first time this nice Twitter lib and I'm having trouble
I'm trying to do something simple : getting my list of friends.

```
TwitterCredentials.SetCredentials(ConfigurationManager.AppSettings["twitterConsumerKey"],
ConfigurationManager.AppSettings["twitterConsumerSecret"],
ConfigurationManager.AppSettings["twitterAccessToken"],
ConfigurationManager.AppSettings["twitterAccessTokenSecret"]);
foreach (var friend in User.GetLoggedUser().GetFriends())
{
Console.WriteLine("{0}\n", friend.Name);
}
```

But I keep getting a NullReferenceException in the foreach, and it's driving me nuts...
Any help or hint would be welcome if some if you have already encountered such an issue first time you used it.

Many thanks
Comments: ** Comment from web user: wiart **

An important point : I'm creating a command line application with VS2010


Viewing all articles
Browse latest Browse all 4126

Trending Articles