Forum Discussion

Leopold_'s avatar
Leopold_
New member | Level 2
3 years ago

Code is stuck on await Methods

I am trying to implement a Dropbox support in my Maui application on Windows and Android. I have set everything up according to the documentation and basic stuff like getting the email address of my account works well. 

Sadly, anything related to the data on my drive doesn't work. For example, when I call this task from the documentation, the code is stuck on the await method and never responses. No exception is thrown. This happens with every async method regarding the data on my drive, like downloading a file or reading the files. 

What did I do wrong? 

 

async Task Upload(DropboxClient dbx, string folder, string file, string content)
{
    using (var mem = new MemoryStream(Encoding.UTF8.GetBytes(content)))
    {
         var updated = await dbx.Files.UploadAsync(                            <-- a breakpoint here is called
            folder + "/" + file,
            WriteMode.Overwrite.Instance,
            body: mem); //Code does never respond after this breakpoint
        Console.WriteLine("Saved {0}/{1} rev {2}", folder, file, updated.Rev); <-- but the breakpoint here never gets called
    }
}

 

 

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,941 PostsLatest Activity: 2 days ago
351 Following

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 or Facebook.

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!