0

When creating a new mvc4 internet project with the internet application template when you install the tweetsharp nuget packack it is giving me and error message on service.VerifyCredentials();

using TweetSharp;

public ActionResult AuthorizeCallback(string oauth_token, string oauth_verifier)
{
  var requestToken = new OAuthRequestToken {Token = oauth_token};

// Step 3 - Exchange the Request Token for an Access Token
TwitterService service = new TwitterService(_consumerKey, _consumerSecret);
OAuthAccessToken accessToken = service.GetAccessToken(requestToken, oauth_verifier);

// Step 4 - User authenticates using the Access Token
service.AuthenticateWith(accessToken.Token, accessToken.TokenSecret);
TwitterUser user = service.VerifyCredentials(); // HERE
ViewModel.Message = string.Format("Your username is {0}", user.ScreenName);
return View();

}

Error: No overload for method 'VerifyCredentials' takes 0 arguments

It works fine if I don't use the Internet application template.. Can anyone tell me why this is happening and a solution?

Trevor
  • 16,080
  • 9
  • 52
  • 83

1 Answers1

1

There may be a TweetSharp update in the future to fix this.

But this is a current work around when implementing TweetSharp with the Internet application template

TwitterUser user = service.VerifyCredentials(new VerifyCredentialsOptions());
// instead of TwitterUser user = service.VerifyCredentials();
Trevor
  • 16,080
  • 9
  • 52
  • 83