locked
Version Conflict with RestSharp RRS feed

  • Question

  • Hi I'm trying to update my Class library from version 2.0 to 4.5.2 and my old library using RestSharp.Net2 reference also and i'm getting below error when update my library to 4.5.2 

    Any help please , Thanks in Advance...

    Error Log: 

    The type 'Action' exists in both 'RestSharp.Net2, Version=102.7.0.0, Culture=neutral, PublicKeyToken=e179d1049b315bf3' and 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'

    Here is my calling Code:

    private void CallAsyncInternal<T>(IRestRequest request, Action<RestResponse<T>> callback,

                frmRetryHandler theForm, int retryNumber = 0) where T : new()

            {

                if (retryNumber >= frmRetryHandler.MaxRetries)

                {

                    throw new TimeoutException($"Unable to successfully call method '{TheClient.BuildUri(request)}' after 10 retries.");

                }

                if (!this.IsHandleCreated)

                {

                    this.CreateHandle();

                }

                TheClient.ExecuteAsync(request, (RestResponse<T> response) =>

                {

                    try

                    {

                        if (response.StatusCode == 0)

                        {

                            throw new TimeoutException($"Request to {TheClient.BuildUri(request)} timed out.");

                        }

                        callback(response);

                    }

                    catch (TimeoutException)

                    {

                        if (theForm._owner == null || !theForm.IsHandleCreated)

                        {

                            throw;

                        }

                        theForm.BeginInvoke(new System.Action(() =>

                        {

                            using (var overlay = new BackgroundMask(theForm._owner, theForm))

                            {

                                if (overlay.ShowMaskedDialogBox() == DialogResult.Retry)

                                {

                                    TheClient.Timeout = GetNewTimeoutTime(retryNumber);

                                    CallAsyncInternal<T>(request, callback, theForm, retryNumber + 1);

                                    return;

                                }

                                throw new TimeoutException($"User cancelled asynchronous service call to {request.Resource}.");

                            }

                        }));

                    }

                });

            }


    Friday, June 8, 2018 3:06 PM

All replies