NullReferenceException-> Hammock.WindowsPhone.dll! Hammoc

本文关键字:dll Hammoc WindowsPhone Hammock gt NullReferenceException- | 更新日期: 2023-09-27 18:35:01

我想在我的应用程序中使用Twitter,并且我正在使用Hammock Windows DLL使用Twitter,所以当我像这样创建其余客户端时

private void GetTwitterToken()
{
    var credentials = new OAuthCredentials
    {
        Type = OAuthType.RequestToken,
        SignatureMethod = OAuthSignatureMethod.HmacSha1,
        ParameterHandling = OAuthParameterHandling.HttpAuthorizationHeader,
        ConsumerKey = MyTwitter.ConsumerKey,
        ConsumerSecret = MyTwitter.ConsumerSecret,
        Version = MyTwitter.OAuthVersion,
        CallbackUrl = MyTwitter.CallbackUri
    };
    /*
    var client = new RestClient
    {
        Authority = "https://api.twitter.com/oauth",
        Credentials = credentials,
        HasElevatedPermissions = true
    };
    */
    var client = new RestClient
    {
        Authority = "https://api.twitter.com/oauth",
        Credentials = credentials,
        HasElevatedPermissions = true,
        SilverlightAcceptEncodingHeader = "gzip",
        DecompressionMethods = DecompressionMethods.GZip
    };
    var request = new RestRequest
    {
        Path = "/request_token"
    };
    client.BeginRequest(request, new RestCallback(TwitterRequestTokenCompleted));
}
private void TwitterRequestTokenCompleted(RestRequest request, RestResponse response, object userstate)
{
    Debug.WriteLine("Twitter Request Token Completed");
    _oAuthToken = GetQueryParameter(response.Content, "oauth_token");
    _oAuthTokenSecret = GetQueryParameter(response.Content, "oauth_token_secret");
    var authorizeUrl = MyTwitter.AuthorizeUri + "?oauth_token=" + _oAuthToken;
    if (String.IsNullOrEmpty(_oAuthToken) || String.IsNullOrEmpty(_oAuthTokenSecret))
    {
        Dispatcher.BeginInvoke(() => MessageBox.Show("error calling twitter"));
        return;
    }
    Dispatcher.BeginInvoke(() => browserControl.Navigate(new Uri(authorizeUrl)));
}

我收到错误为NullReferenceException->Hammock.WindowsPhone.dll!

Hammock.Silverlight.Compat.GzipHttpWebResponse.GetResponseStream(( + 0x1c 字节

在堆栈中,我收到错误为

at Hammock.Silverlight.Compat.GzipHttpWebResponse.GetResponseStream((

at Hammock.Web.WebQuery.GetAsyncResponseCallback(IAsyncResult asyncResult(

at System.Net.Browser.ClientHttpWebRequest.<>c_DisplayClassa.b_8(Object state2(

在System.Threading.ThreadPool.WorkItem.WaitCallback_Context(对象状态(

at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state(

at System.Threading.ThreadPool.WorkItem.doWork(Object o(

at System.Threading.Timer.ring((

可能是什么问题?

NullReferenceException->	Hammock.WindowsPhone.dll! Hammoc

有参考问题,导致问题,已修复,感谢您的支持乔恩