Open pradeepinfotechi opened 2 years ago
Hi @pradeepinfotechi
I am taking a look and trying to reproduce this particular error. I haven't been able to yet but in the meantime, could I ask you to keep the version as 108.0.1 and try clear your nuget cache and re-running your project. Does the error persist?
dotnet nuget locals all --clear
dotnet clean
dotnet build
dotnet run
Xero.Netstandard.OAuth2.Client - 1.6 Xero.Netstandard.OAuth2 - 3.29
Resthsharp - 108. 0.1.0 Also tried with 108.0.2.0
Authorization is getting successful and later when try to create invoice using async method gets error
Method not found: 'Void RestSharp.RestRequest..ctor(RestSharp.Method)'.
Earlier used with Restsharp 106.X version, we didn't had any issue. Due to other features we have upgraded Restsharp later xero integration stopped working with above issue.
Sample Code below
In line var xeroResp = await AccountingApi.CreateInvoicesAsync(accessToken, t.TenantId.ToString(), objInvoices); // we get the issue.
public async Task GetTenants(string code)
{
LoggerMethodName = "Method: GetTenants";
strErrMsg = string.Empty;
bool result = false;
try
{
var tenantList = new List();
using (var client = new HttpClient())
{
var response = await client.RequestAuthorizationCodeTokenAsync(new AuthorizationCodeTokenRequest
{
Address = "https://identity.xero.com/connect/token",
GrantType = "code",
Code = code,
ClientId = xeroConfiguration.ClientId,
ClientSecret = xeroConfiguration.ClientSecret,
RedirectUri = xeroConfiguration.CallbackUri.ToString(),
Parameters =
{
{ "scope", xeroConfiguration.Scope}
}
});