Getting WaitingForActivation while using c# sdk

  • 1
  • Question
  • Updated 7 months ago
  • (Edited)
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 
Photo of Hardik Joshi

Hardik Joshi

  • 650 Points 500 badge 2x thumb

Posted 7 months ago

  • 1
Photo of Tyler Long

Tyler Long, Official Rep

  • 5,914 Points 5k badge 2x thumb
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
Photo of Hardik Joshi

Hardik Joshi

  • 650 Points 500 badge 2x thumb
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
Photo of Tyler Long

Tyler Long, Official Rep

  • 5,914 Points 5k badge 2x thumb
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...
Photo of Tyler Long

Tyler Long, Official Rep

  • 5,914 Points 5k badge 2x thumb
According to this: https://stackoverflow.com/a/14527164/862862

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