Hi, it might be deadlock issue.
And it is a common C# async programming issue:
https://medium.com/rubrikkgroup/understanding-async-avoiding-deadlocks-e41f8f2c6f5dIn short, do not mixed async code and sync code. If your app is async overall, you should not use .Result.
Thanks, call log work perfect but when i want to send sms like
static async Task Main(string[] args)
{
using (var rc = await Login()) { await SendSms(rc); } }
private static async Task<RestClient> Login()
{
var rc = new RestClient("***", "*********", "https://platform.devtest.ringcentral.com/");
await rc.Authorize("+*****", "101", "*****");
return rc;
} public static async Task SendSms(RestClient rc)
{
var sms = new CreateSMSMessage()
{
@from = new MessageStoreCallerInfoRequest() { phoneNumber = "+****" },
to = new[] { new MessageStoreCallerInfoRequest() { phoneNumber = "+****" }, },
text = "test yaacov"
};
var resTask = await rc.Restapi().Account().Extension("101").Sms().Post(sms);
}
The Authorize return token but post sms get exception
System.ObjectDisposedException: 'Cannot access a disposed object.
Object name: 'System.Net.Http.StringContent'.'
When i run same details with Api reference "try it out" button it work fine