Getting “Resource not found error” while using Azure File Sync

五迷三道 提交于 2019-12-12 02:36:41

问题


Facing a very strange issue.

Following this guide https://azure.microsoft.com/en-in/documentation/articles/app-service-mobile-xamarin-forms-blob-storage/ to implement File Sync in Xamarin Forms app.

The Get method in my service (GetUser, default get method in App service controller) is being called thrice & on the 3rd iteration it gives me a 404 resource not found error. First 2 iterations work fine. This is the client call

await userTable.PullAsync(
                        null,
                        userTable.Where(x => x.Email == userEmail), false, new System.Threading.CancellationToken(), null);

If I remove the following line,

// Initialize file sync
this.client.InitializeFileSyncContext(new TodoItemFileSyncHandler(this), store);

then the code works just fine, without any errors. I will need some time doing a sample project, meanwhile if anyone can shed some light, it will be of help.

Thanks


回答1:


This won't be an answer, because there isn't enough information to go on. When you get a 404, it's because the backend returned a 404. The ideal situation is:

  • Turn on Diagnostic Logging in the Azure Portal for your backend
  • Use Fiddler to monitor the requests
  • When the request causes a 404, look at what is actually happening

If you are using an ASP.NET backend (and I'm assuming you are because all the File tutorials use ASP.NET), then you can set a breakpoint on the appropriate method in the backend and follow it through. You will need to deploy a debug version of your code.




回答2:


this is sorted now, eventually I had to give it what it was asking for. I had to create a storage controller for User too, although I don't need one as I don't need to save any files in storage against the users.

I am testing the app further now to see if this sorts my problem completely or I need a storage controller for every entity I use in my app.

In which case it will be really odd as I don't intend to use the storage for all my entities.



来源:https://stackoverflow.com/questions/39575825/getting-resource-not-found-error-while-using-azure-file-sync

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!