0
votes

Sample Source Code:

https://drive.google.com/file/d/0BzYXG8uD6JT3ai1SN3lfRE5oNWs/view

Background:

Creating a Xamarin Forms app with Azure Data Sync with Azure app Services as backend. Using Dot Net based Managed backend on azure.

My Issue:

My app works fine in offline mode & I can click on sync to sync all offline data to azure.

If now I need to also incorporate File Syncing so I can use files in my app in offline mode & also sync them to azure, I can use Azure File Sync. I am following the steps given here:

https://azure.microsoft.com/en-in/documentation/articles/app-service-mobile-xamarin-forms-blob-storage/

In the attached sample code, If you comment the file sync related code in AzureHelper.cs at line numbers 44, 46 & 74 and uncomment the data sync call at Line number 41 it works as expected.

If you now comment the code on Line Number 41 & uncomment the code for for File Sync at 44, 46, 74 in the same file & run the code, you get a 500 error. Moreover this 500 error is shown in a Box in Visual Studio as an unhandlled exception, where as I have catch block used at all possible erroneous locations. Because of this it has become incredibly difficult to catch the source of this error.

This is what led me to believe that the error is somewhere in File Sync changes, just can't figure out what block?

Can someone please shed some light on this?

Thanks ST

1
If you add AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; in your application, could you get the exception?Jambor - MSFT
Just added this in ios App Delegate, will update if I get somethingSupreet
ErrorObjct,Message="The resource you are looking for has been removed, had its name changed, or is temporarily unavailable." ReasonPhrase: Not Found All it does is make a simple Get call to mu User Controller on the service twice, the first time it returns a result & 2nd, time I see this error.Supreet
using fiddler I figured out it's trying to find files for my User object too GET /tables/User/0d8e214a-ba22-447a-9eb5-4afb36f4c5b4/MobileServ‌​iceFiles HTTP/1.1 which it don't understand why? I have several entities in my app & I intend to use files for only a few of them. User entity is not one of them. So 2 questions here: 1. Will it try & find a file for each DTO I have in my app? 2. If so, how do I restrict it to only a few selected ones? Looking forward for your responseSupreet

1 Answers

0
votes

Either you need to create storage controller for all, or modify the

public sealed class ReportSwiftEntityDataFileSyncTrigger : IFileSyncTrigger, IDisposable
{
private async void OnStoreOperationCompleted(StoreOperationCompletedEvent storeOperationEvent)
        {
            if (storeOperationEvent.Operation.TableName!="Report")
            {
                return; 
            }
        }
}

class as shown to ignore any cases where class name is not where you need to use the storage controller.

Hope this helps.