Thursday 15 September 2011

Try/Catch not working for WP8 C# .NET with Azure Mobile Services -


I am playing with this block code:

  try {mscvUser = imstUser} . (Where user = & gt; User.Id == intId). Take (1000) .toCollectionView (); } Catch (MobileServiceInvalidOperationException f) {MessageBox.Show (f.ToString ()); }   

It works well in general, but I deliberately disconnect my internet for testing purposes, and I continue to beat the exceptionally mobile operation, but it Will not catch in the block; This throws it back on App.xaml.cs, breaks, and closes the app.

I think you are not using the latest version of Azure Mobile Services recently for SDK Version 1.0 was updated:

I checked with this version and the exception has been captured correctly.

In the latest version, "ToCollectionView" was changed and now you have to use

  try {mscvUser = awst imstUser. Where (user = & gt; User.Id == intId). Take (1000) .toCollectionAsync (); } Catch (MobileServiceInvalidOperationException f) {MessageBox.Show (f.ToString ()); }   

Hope this helps

Edit: ChangeLog here:

MobileServiceTable.ToCollectionView () Now ToCollection (): There were some bugs in the collection view implementation, and it has been rewritten.



No comments:

Post a Comment