Need to see if your shared folder is taking up space on your dropbox 👨‍💻? Find out how to check here.

Forum Discussion

robertmiles3's avatar
robertmiles3
Helpful | Level 5
9 years ago
Solved

System.MissingFieldException using Dropbox.Api 4.3.1 on Xamarin.iOS

 

I'm attempting a test file upload using...

 

using (var client = new DropboxClient("MY_GENERATED_ACCESS_TOKEN"))
using (var stream = new MemoryStream(Encoding.UTF8.GetBytes("some text")))
{
    var updated = await client.Files.UploadAsync(
        path: $"/Backup-{DateTime.Now.ToString("yyyy-MM-dd-HH.mm.ss.fff")}.json",
        mode: WriteMode.Overwrite.Instance,
        autorename: false,
        clientModified: null,
        mute: false,
        body: stream);
}

 

But, I'm getting a System.MissingFieldException...

 

System.MissingFieldException: Field 'Dropbox.Api.DropboxRequestHandler/<Dropbox.Api.Stone.ITransport.SendUploadRequestAsync>d__d`3<TRequest_REF, TResponse_REF, TError_REF>.<>4__this' not found.
  at Dropbox.Api.Files.Routes.FilesUserRoutes.UploadAsync (Dropbox.Api.Files.CommitInfo commitInfo, System.IO.Stream body) [0x00006] in <4ef505fca4004e3fa64095111cf70e73>:0 
  at Dropbox.Api.Files.Routes.FilesUserRoutes.UploadAsync (System.String path, Dropbox.Api.Files.WriteMode mode, System.Boolean autorename, System.Nullable`1[T] clientModified, System.Boolean mute, System.IO.Stream body) [0x0000d] in <4ef505fca4004e3fa64095111cf70e73>:0 
  at yomomma.Services.DataService+<BackupAsync>d__3.MoveNext () [0x0005a] in /Users/yomomma/Dropbox/dev/yomomma/yomomma.Shared/Services/DataService.cs:111 

I'm using a "Generated Access Token" that I've created on my developer portal. Any ideas as to what is going on here? It's not a helpful error message at all.

 

 

 

 

 

  • I actually just got it working. I had to add the "Microsoft.Bcl.Async" package as well. I noticed some errors in the console saying that "Microsoft.Threading.Tasks" wasn't found. After I added this package, all is well.

4 Replies

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    9 years ago

    Did you install the Dropbox.Api package? That's not built for Xamarin, but there is a third party version meant for Xamarin: Xamarin.Dropbox.Api. That's made by a third party, so we can't officially support or endorse it, but it may work for you.

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    9 years ago
    Thanks for confirming that. I just tried this code using v4.3.1 of the SDK in Visual Studio (not Xamarin), and it worked there. That being the case it seems the issue is specific to Xamarin, so I'm afraid I can't offer a solution. I'll send this along as a request for official support for the SDK on Xamarin.
  • robertmiles3's avatar
    robertmiles3
    Helpful | Level 5
    9 years ago
    I actually just got it working. I had to add the "Microsoft.Bcl.Async" package as well. I noticed some errors in the console saying that "Microsoft.Threading.Tasks" wasn't found. After I added this package, all is well.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!