question

sravani kandarpa avatar image
sravani kandarpa asked Anirban answered

.Net framework 4.5 await authorize hangs

I am running below code from my console application and it works perfectly and I can fetch data

static async Task GetCallLogs() {
 var rc = new RestClient(RINGCENTRAL_CLIENT_ID, RINGCENTRAL_CLIENT_SECRET, RINGCENTRAL_PRODUCTION_URL); await rc.Authorize("username", "ext", "password"); 
// making api calls
}


But when I am doing the same thing from the .NET framework controller, system hangs at await

public void  UpdateRingCentral()
   {
             var t= new GetCallLogs();
             t.Wait();
   }
public async Task GetCallLogs() { 
var rc = new RestClient(RINGCENTRAL_CLIENT_ID, RINGCENTRAL_CLIENT_SECRET, RINGCENTRAL_PRODUCTION_URL); await rc.Authorize("username", "ext", "password"); 
// making api calls
}


Any advice or suggestions for fixing this issue.

async c#
1 |1500 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

sravani kandarpa avatar image
sravani kandarpa answered
1 |1500 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Anirban avatar image
Anirban answered

This is a very common feature of .net platform which arise deadlock condition during making the actual REST call and parsing it as JSON .

There are many ways you can prevent this mentioned here .

Also refer here to get your answer

Another link you should read:

https://devblogs.microsoft.com/pfxteam/await-and-ui-and-deadlocks-oh-my/

1 |1500 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Anirban avatar image
Anirban answered

There is fee more docs available on these type of issue here.

1 |1500 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys