You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

Paul M.131's avatar
Paul M.131
Explorer | Level 4
4 years ago

.NET SDK OAuthTest sample app error

Hi,

I'm looking to migrate my Windows .NET service app (no user interaction) from a long lived token to a short-lived token.

I am working through the OAuthTest app, and have entered my apps ApiKey and ApiSecret.  I have also set the Redirect URI to http://127.0.0.1:52579/authorize

When debugging the code, it runs as far as the AcquireAccessToken method, down to the code line http.Start();, and on this line an error occurs stating "The process cannot access the file because it is being used by another process".  I am puzzled as to what the file could be.

I have tried moving the code folder to another location on the PC, "cleaning" the solution, but nothing resolves this error.

Strangely, I have copied my code to another couple of PCs and it runs perfectly!!

I would like to understand what's causing this issue on my main development machine.

Any ideas?

Regards,

Paul

  • That 'http.Start' call starts the local web server which is used to catch the redirect from the app authorization flow. The error message seems to be indicating that the server can't be started, perhaps because that port is already in use. Is there anything on that computer using that port, or do you maybe accidentally already have another instance of the sample app process running?

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    That 'http.Start' call starts the local web server which is used to catch the redirect from the app authorization flow. The error message seems to be indicating that the server can't be started, perhaps because that port is already in use. Is there anything on that computer using that port, or do you maybe accidentally already have another instance of the sample app process running?

    • Paul M.131's avatar
      Paul M.131
      Explorer | Level 4

      Hi Greg, many thanks for the advice, it turned out it was the port.

      I had tried restarting the PC, running VS as Admin, and also tried other ports in the vicinity of that in the original sample code.  In the end I changed the port to 8080, and it worked.

      I had wondered if the error message was misleading (not for the 1st time).

      Thanks again for your quick response and advice.

      Regards,

      Paul

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,910 PostsLatest Activity: 3 days ago
333 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!