1
votes

Here's the line where I get that error:

var requestToken = OAuthUtility.GetRequestToken(
    _consumerKey, 
    _consumerSecret, 
    "http://mysite.com/Twitter/GetToken");

_consumerKey and _consumerSecret have proper values.

Stack Trace:

[ArgumentNullException: Value cannot be null. Parameter name: String] System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +9585854 System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +119 Twitterizer.TwitterizerException.ParseRateLimitHeaders(WebResponse response) in C:\Projects\twitterizer-132\Twitterizer2\Exceptions\TwitterizerException.cs:200 Twitterizer.TwitterizerException..ctor(String message, Exception innerException) in C:\Projects\twitterizer-132\Twitterizer2\Exceptions\TwitterizerException.cs:98 Twitterizer.OAuthUtility.GetRequestToken(String consumerKey, String consumerSecret, String callbackAddress) in C:\Projects\twitterizer-132\Twitterizer2\OAuth\OAuthUtility.cs:95 Brace.Twitter.Tweeting.GetRequestTokenUrl() in D:\PROJECTS\Brace\v1\Brace.Twitter\Tweeting.cs:18 Brace.Controllers.TwitterController.GetToken(String oauth_token, String oauth_verifier) in D:\PROJECTS\Brace\v1\Brace\Controllers\TwitterController.cs:15 lambda_method(Closure , ControllerBase , Object[] ) +157 System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +17 System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary2 parameters) +208 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary2 parameters) +27 System.Web.Mvc.<>c_DisplayClass15.b_12() +55 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func1 continuation) +263 System.Web.Mvc.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() +19 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList1 filters, ActionDescriptor actionDescriptor, IDictionary2 parameters) +191 System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +343 System.Web.Mvc.Controller.ExecuteCore() +116 System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +97 System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +10 System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +37 System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +21 System.Web.Mvc.Async.<>c__DisplayClass81.b__7(IAsyncResult ) +12 System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62 System.Web.Mvc.<>c_DisplayClasse.b_d() +50 System.Web.Mvc.SecurityUtil.b_0(Action f) +7 System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +22 System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +60 System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8963149 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184

1

1 Answers

1
votes

Here's my best attempt at being overly vague: this bug is actually a symptom of another issue.

More than likely, your application (not your actual application, but the registration with Twitter that gave you your console token) is not set up as a web application. Their form is misleading: it doesn't make the callback url required when you select a web app, but it actually is required. When you save your app without a callback url, it actually saves it as a desktop app.

The problem with a desktop app is that you can't use callback urls. Web apps can used pin-based authentication, but desktop apps can't use web-based authentication. (I'm sure there's a perfectly good reason.)

So, twitter is rejecting your request to get a request token, because you're also providing a callback.

The actual exception is because Twitterizer is still looking for rate limit information that's included in every (well, ok, almost-every) response, even from requests that failed.

I will (finally) fix that issue, but it won't solve your real problem.