0

I've been looking into this error that I keep getting and can't find the right solution. It seems like it's unique to the person. Does anyone know why I am getting the error? Greatly appreciate the time.

    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
        }
}

I get an error on:

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

TypeLoadException was unhandled Could not load type 'System.Action' from assembly 'mscorlib, Version=3.7.0.0, Culture=neutral, PublicKeyToken=969DB8053D3322AC'.

Tom
  • 1,187
  • 2
  • 12
  • 21
  • Hi Tom. Now i am facing this same problem. Can you please tell me how you resolved this problem?? – Vijay Sep 22 '14 at 05:33

1 Answers1

0

I found this answer. It helped me with the same issue hopefully it helps you!

TypeLoadException says 'no implementation', but it is implemented

Community
  • 1
  • 1
Four_0h_Three
  • 592
  • 10
  • 27