cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox 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: 

Re: .NET SDK OAuthTest sample app error

.NET SDK OAuthTest sample app error

Paul M.131
Explorer | Level 4
Go to solution

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

Greg-DB
Dropbox Staff
Go to solution

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

Greg-DB
Dropbox Staff
Go to solution

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
Explorer | Level 4
Go to solution

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

Need more support?