One month down in 2025: How are your resolutions coming along? Check out how to get back on track here.
Forum Discussion
Leopold_
3 years agoNew member | Level 2
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 } }
- Greg-DB
Dropbox Staff
I don't see anything wrong in this snippet of code, and it runs successfully for me.
When you say "basic stuff like getting the email address of my account works well", it sounds like you're referring to the GetCurrentAccountAsync method. For comparison, that method calls api.dropboxapi.com, whereas methods that interact with file data, such as UploadAsync, call content.dropboxapi.com.
Is there anything on your network connection, such as a firewall, VPN, proxy, anti-virus, etc., that may be interfering with the connection to content.dropboxapi.com in particular?
Otherwise, it may be due to how you're handling async operations in your app. That would be a more about programming in C#/.NET itself and outside the scope of Dropbox API support, but there are some similar questions here that may be helpful:
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,941 PostsLatest Activity: 2 days ago
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!