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

Created 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

Viewing all articles
Browse latest Browse all 4126

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>