Closed Yahya0007 closed 6 months ago
PETOSS-336
Thanks for raising an issue, a ticket has been created to track your request
An update.
We are making api call GetContactByContactNumberAsync.
When we use RestSharp 108.0.1.0 we get error “Could not load file or assembly 'RestSharp, Version=110.1.0.0, Culture=neutral, PublicKeyToken=598062e77f915f75' or one of its dependencies. The system cannot find the file specified.”
When we use RestSharp 110.1.0.0 we get error “Method not found: 'RestSharp.RestRequest RestSharp.RestRequestExtensions.AddFile(RestSharp.RestRequest, System.String, Byte[], System.String, System.String)'”.
Can you recommend a RestSharp version for Xero?
Please see location of error in attached image. It seems to be within Xero SDK.
Is this something you guys would be able to look at? Thanks.
I have attached a screenshot pinpointing the procedure causing the error inside Xero SDK. Any help would be appreciated. Some helpful comments from your dev team would be nice.
We are desperate.
I've encountered the same problem today while upgrade RestSharp to the latest version in our project. I've taken a fork of the Xero-NetStandard code and updated it to the latest RestSharp (and Newtonsoft.Json) versions and I will be testing it and pushing it to our production environment all being well.
There's already a PR from @AshleyMedway (#478) that resolves this issue as far as I can tell.
Encountered this problem today. Is there a way to resolve this?
Encountered this problem today. Is there a way to resolve this?
There's only a work around at the moment, which is to download the repo, update the nuget package references for RestSharp yourself, and then compile into either a local nuget package, or just the dlls and use those instead of the live Xero Nuget pacakages.
Please fix this :)
This is critical. I am currently utilizing the BoldSign SDK, Google, and other 3rd-party SDKs in my Windows Form application. All these SDKs require the latest RestSharp (version 110.2.0.0). However, the Xero SDK is not compatible with this version, resulting in issues with SearchInvoice APIs and other accounting APIs. The error message returned is: (Method not found: 'RestSharp.RestRequest RestSharp.RestRequestExtensions.AddFile(RestSharp.RestRequest, System.String, Byte[], System.String, System.String)) I understand the reasons behind this issue and can provide further details if needed. Kindly update the Xero SDK to ensure compatibility with the latest RestSharp.
Thanks.
I got the same problem too. Please fix it.
Downgraded the RestSharp to 106.15.0 seems solved the problem
But what should we do if other libs depend on the new RestSharp, i means if we are forced to update the Restsharp to the lasts one ?
Yeah.. nah. I presume they're using swaggergen which has old dependencies..
Your only option is to fork the library, update the RestSharp dependancies and compile the binary. I created a fork myself and did this myself and it's been working well for me while waiting for Xero to update https://github.com/amyskippy/Xero-NetStandard
I'm a little disappointed that it's been over 3 months and it's still an outstanding issue. I'm going to the Xero convention next year, so I might try and raise this with someone as it's not really acceptable
I have the same problem. Can't believe Xero havn't sorted this yet.
[sad] Ali Ashraf reacted to your message:
From: Anton Zherdev @.> Sent: Wednesday, January 3, 2024 11:18:08 PM To: XeroAPI/Xero-NetStandard @.> Cc: Ali Ashraf @.>; Comment @.> Subject: Re: [XeroAPI/Xero-NetStandard] Method not found: 'RestSharp.RestRequest RestSharp.RestRequestExtensions.AddFile(RestSharp.RestRequest, System.String, Byte[], System.String, System.String)'. (Issue #484)
Closed #484https://github.com/XeroAPI/Xero-NetStandard/issues/484 as completed.
— Reply to this email directly, view it on GitHubhttps://github.com/XeroAPI/Xero-NetStandard/issues/484#event-11383957053, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BCXKV5ZYAXCSACG63DN5IZLYMXRLBAVCNFSM6AAAAAA3RHMMV6VHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJRGM4DGOJVG4YDKMY. You are receiving this because you commented.Message ID: @.***>
The issue has been resolved in the latest version of the library.
SDK you're using (please complete the following information):
Describe the bug When calling code;
result = Await apiInstance.GetInvoicesAsync(xeroToken.AccessToken, xeroTenantId,, where)
getting error 'Method not found: 'RestSharp.RestRequest RestSharp.RestRequestExtensions.AddFile(RestSharp.RestRequest, System.String, Byte[], System.String, System.String)'.'.To Reproduce Use this code to get the error;
result = Await apiInstance.GetInvoicesAsync(xeroToken.AccessToken, xeroTenantId,, where)
Expected behavior No error.
Additional context This started happening recently on code running fine for months.