System.Action无法加载

时间:2012-07-04 02:06:37

标签: c# api windows-phone-7 twitter hammock

我一直在调查这个错误,我一直在找不到合适的解决方案。这似乎是这个人的独特之处。有谁知道我为什么会收到这个错误? 非常感谢时间。

    public void uploadPhoto(Stream photoStream, string photoName)
{
var credentials = new OAuthCredentials
        {
            Type = OAuthType.ProtectedResource,
            SignatureMethod = OAuthSignatureMethod.HmacSha1,
            ParameterHandling = OAuthParameterHandling.HttpAuthorizationHeader,
            ConsumerKey = TwitterSettings.consumerKey,
            ConsumerSecret = TwitterSettings.consumerKeySecret,
            Token = TwitterSettings.accessToken,
            TokenSecret = TwitterSettings.accessTokenSecret,
            Version = "1.0a"
        };


        RestClient restClient = new RestClient
        {
            Authority = "https://upload.twitter.com",
            HasElevatedPermissions = true,
            Credentials = credentials,
            Method = WebMethod.Post
         };
         RestRequest restRequest = new RestRequest
         {
            Path = "1/statuses/update_with_media.json"
         };

         restRequest.AddParameter("status", tbxNewTweet.Text);
         restRequest.AddFile("media[]", photoName, photoStream, "image/jpg");

}

    restClient.BeginRequest(restRequest, new RestCallback(PostTweetRequestCallback));
}


private void PostTweetRequestCallback(RestRequest request, Hammock.RestResponse response, object obj)
{
        if (response.StatusCode == System.Net.HttpStatusCode.OK)
        {
        //Success code
        }
}

我收到错误:

 restClient.BeginRequest(restRequest, new RestCallback(PostTweetRequestCallback));

TypeLoadException未处理 无法从程序集'mscorlib,Version = 3.7.0.0,Culture = neutral,PublicKeyToken = 969DB8053D3322AC'加载类型'System.Action'。

1 个答案:

答案 0 :(得分:0)

我找到了这个答案。它帮助了我同样的问题,希望它可以帮助你!

TypeLoadException says 'no implementation', but it is implemented