Tom
Tom

Reputation: 1227

System.Action could not load

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'.

Upvotes: 0

Views: 1095

Answers (1)

Four_0h_Three
Four_0h_Three

Reputation: 612

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

TypeLoadException says 'no implementation', but it is implemented

Upvotes: 0

Related Questions