XeroAPI / Xero-NetStandard

A wrapper of the Xero API in the .NetStandard 2.0 framework. Supports Accounting, Payroll AU/US, and Files
MIT License
118 stars 119 forks source link

System.MissingMethodException with latest RestSharp client #513

Open yosefmah opened 1 month ago

yosefmah commented 1 month ago

SDK you're using (please complete the following information):

Describe the bug After upgrading to the latest version of Restsharp v111.0.0, the library the API calls result in an error as shown below. Downgrading back to 110.2 results in working successfully again.

To Reproduce Steps to reproduce the behavior:

  1. Upgrade to latest release of Restsharp in project.
  2. Call the GetInvoices method

Expected behavior Would expect the method to return a list of invoices.

Error:

Unhandled exception. System.AggregateException: One or more errors occurred. (Method not found: 'Void RestSharp.RestRequest.set_Timeout(Int32)'.)
 ---> System.MissingMethodException: Method not found: 'Void RestSharp.RestRequest.set_Timeout(Int32)'.
   at Xero.NetStandard.OAuth2.Client.ApiClient.newRequest(HttpMethod method, String path, RequestOptions options, IReadableConfiguration configuration)
   at Xero.NetStandard.OAuth2.Client.ApiClient.GetAsync[T](String path, RequestOptions options, IReadableConfiguration configuration, CancellationToken cancellationToken)
   at Xero.NetStandard.OAuth2.Api.AccountingApi.GetInvoicesAsyncWithHttpInfo(String accessToken, String xeroTenantId, Nullable`1 ifModifiedSince, String where, String order, List`1 iDs, List`1 invoiceNumbers, List`1 contactIDs, List`1 statuses, Nullable`1 page, Nullable`1 includeArchived, Nullable`1 createdByMyApp, Nullable`1 unitdp, Nullable`1 summaryOnly, CancellationToken cancellationToken)
   at Xero.NetStandard.OAuth2.Api.AccountingApi.GetInvoicesAsync(String accessToken, String xeroTenantId, Nullable`1 ifModifiedSince, String where, String order, List`1 iDs, List`1 invoiceNumbers, List`1 contactIDs, List`1 statuses, Nullable`1 page, Nullable`1 includeArchived, Nullable`1 createdByMyApp, Nullable`1 unitdp, Nullable`1 summaryOnly, CancellationToken cancellationToken)
github-actions[bot] commented 1 month ago

PETOSS-425

github-actions[bot] commented 1 month ago

Thanks for raising an issue, a ticket has been created to track your request

DevelopmentDan commented 1 month ago

This is generally an issue with this API - it uses a lot of NuGet packages, that if we try to update to the latest version it breaks the Xero API. I ran into this problem too today.

The versions of Microsoft.IdentityModel.JsonWebTokens, System.IdentityModel.Tokens.Jwt used by Xero both have vulnerabilities.