Skip to main content

Hi,


I am using c# sdk for my server application.i have already done authorization using appKey and appSecret and user name password.


now when i am going call method to get the messages (Message List) from c# using below code.its giving me following response.


Request :


var extension = rc.Restapi().Account().Extension();


var response = await extension.MessageStore().List();


var messages = response.records;


in response i am getting below :


Id = 1487

Status = WaitingForActivation

Result = null


can you please help me solve this problem

The C# SDK is async.

  var response = await extension.MessageStore().List();

Do not omit the await keyword.

 Or you can try the following:

var response = extension.MessageStore().List().Result;

Reference: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/async
Thanks Tyler for your reply. but when i am using above mention solutions. it will not giving me any response just stuck over there.

Nothing is happens when i use await keyword or writing .Result as above. it will simply stuck and not able to get any response from it



It's hard to get C# async correct. And it is often "stuck". Generally speaking it is a C# programming issue: https://www.google.com.hk/search?q=c%23+async+stuck&oq=c%23+async+stuck&aqs=chrome..69i57j69...
According to this: https://stackoverflow.com/a/14527164/862862

One possible solution is to use await everywhere. Don't mixup await and .Result

Reply