2

I'm getting this exception when awaiting LoginAsync:

await fb.LoginAsync("user_about_me");

The full stack trace is the following:

{System.InvalidOperationException: Operation is not valid due to the current state of the object.
   at Microsoft.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at Microsoft.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccess(Task task)
   at Microsoft.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Microsoft.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at FacebookServiceClient.FbServiceClient.<Login>d__0.MoveNext()}

I'm using Facebook Client 0.5.0.

The strange thing is that this error doesn't always occur, usually when I start a coding session everything is just fine, but then (after a few debug sessions) this exception popups every time. Any thoughts?

Edit: I have this problem even on the SDK github sample

1 Answer 1

1

The problem is not anything to do with the operation itself after browsing the code I found out that the problem is when the browser fails to connect to facebook this exception is thrown.

2
  • can u please tell me some scenario when the browser fails to connect to facebook? One scenario I see is when there is no network. Any more ? In my application, I can connect to facebook through emulator but not through app.
    – Arjun K R
    Jun 4, 2014 at 11:35
  • On the emulator you can decide the network speed, if the speed is low enough it will generate a timeout ;)
    – DVD
    Jun 5, 2014 at 10:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.