Forum Xamarin Xamarin.Forms

await Methods Except, Don't Catch

ScottErtzScottErtz USMember
edited June 2015 in Xamarin.Forms

I have just begun migrating a fairly complex Windows Phone application to Xamarin Forms and I am finding a lot of issue with async methods. Using SQLite.Net, I have this line of code:

await db.ExecuteAsync(string.Format("drop table if exists {0}", table.Name));

The line does not run ever, though it should, and when it tries to run I get a generic error message:

The problem is, even with a try/catch around it, I cannot get this line, and many others using async, to behave as expected. In this case, expected would be hitting the catch, which it certainly does not.

Best Answer


  • MiguelCervantesMiguelCervantes MXMember ✭✭✭

    Maybe beacuse its in another thread.

    Try executing you db.ExecuteAsync without the await

    Can you please provide that piece of code?

Sign In or Register to comment.