cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
We love to hear how every person gets the most from Dropbox, and it seems everyone has a slightly different use for it - tell us yours here!

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

.NET SDK OAuthTest sample app error

.NET SDK OAuthTest sample app error

Paul M.131
Explorer | Level 4

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

1 Accepted Solution

Accepted Solutions

Re: .NET SDK OAuthTest sample app error

Greg-DB
Dropboxer

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?

View solution in original post

2 Replies 2

Re: .NET SDK OAuthTest sample app error

Greg-DB
Dropboxer

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?

View solution in original post

Re: .NET SDK OAuthTest sample app error

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

Who's talking

Top contributors to this post

  • User avatar
    Paul M.131 Explorer | Level 4
  • User avatar
    Greg-DB Dropboxer
What do Dropbox user levels mean?
Need more support?