简体   繁体   中英

MobileServiceInvalidOperationException is thrown on Xamarin.WindowsPhone 8.1 project

I'm trying to use Azure Mobile Services and Xamarin. I follow all instuctions of official tutorial, created Azure backend for application and downloaded sample quick-start app for Xamarin.Forms from Azure. There is code in TodoItemManager.cs :

public async Task<ObservableCollection<TodoItem>> GetTodoItemsAsync(bool syncItems = false)
    {
        try
        {
            IEnumerable<TodoItem> items = await todoTable
                .Where(todoItem => !todoItem.Done)
                .ToEnumerableAsync();

            return new ObservableCollection<TodoItem>(items);
        }
        catch (MobileServiceInvalidOperationException msioe)
        {
            Debug.WriteLine(@"Invalid sync operation: {0}", msioe.Message);
        }
        catch (Exception e)
        {
            Debug.WriteLine(@"Sync error: {0}", e.Message);
        }
        return null;
    }

And I got MobileServiceInvalidOperationException with message " Invalid sync operation: The request could not be completed. (Not Found) ".
I have tested Azure Backend on UWP App and it works fine. So looks like there is problem in WP8.1 project. Can anybody help with this exception?

所以..我忘了在Windows Phone上启用Internet连接

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM