Click here to Skip to main content
15,881,812 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
I tried to post a tweet using tweetsharp library for windows phone 8 alot but every time i got an error "An exception of type 'System.Exception' occurred in TweetSharpTestApp.DLL but was not handled in user code"

here is the method for posting to twitter :

public void PostToTwitter()
{
Dispatcher dispatcher = Deployment.Current.Dispatcher;
TwitterService service = new TwitterService ("Consumer Key", "Consumer Key Secret");
service.AuthenticateWith("Access Token", "Access Token Secret");

service.SendTweet(new SendTweetOptions { Status = "Tweeting with #tweetsharp" }, (tweet, response) =>
{
if (response.StatusCode == HttpStatusCode.OK)
{
dispatcher.BeginInvoke(() =>
{
MessageBox.Show("Tweet sent!");
}
);

}
else
{
throw new Exception(response.StatusCode.ToString());
}
});
Posted
Comments
ZurdoDev 24-Sep-14 10:57am    
I would suggest contacting whoever made tweetsharp.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900