Xero-NetStandard
Xero-NetStandard copied to clipboard
System.MissingMethodException with latest RestSharp client
SDK you're using (please complete the following information):
- Version 5.0.0
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:
- Upgrade to latest release of Restsharp in project.
- 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)
PETOSS-425
Thanks for raising an issue, a ticket has been created to track your request
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.
Is there any news on this? I can see a reasonable fix has an open PR for this and this is stopping us from removing package vulnerabilities as well.
Any update on this would be much appreciated
Hey @yosefmah,
We have replaced RestSharp with core httpClient library in our new Dotnet SDK version 9.0.0
Please install the latest version and hopefully RestSharp issue will not occur anymore.
Closing this card for now as this card was particularly for Restsharp issue.
Please feel free to raise separate issue cards for other vulnerabilities.