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: 

Win32 exception

Win32 exception

donaldp
Collaborator | Level 9

Having got SimpleTest working, 🙂 I've now turned my attention back to my own program to try and sort out the original issue. I thought from memory it was having problems in the same step as we had been with SimpleTest,but it turns out it was actually the NEXT step.

 

In...

System.Diagnostics.Process.Start(authorizeUri.ToString());

I'm getting...

Exception thrown: 'System.ComponentModel.Win32Exception' in System.Diagnostics.Process.dll
The system cannot find the file specified

The system cannot find the file specified
-2147467259
2
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start(String fileName)
at TestDx.App.<GetAccessToken>d__6.MoveNext()
System.Diagnostics.Process
The system cannot find the file specified

 

The extra dignostics there not very helpful (not to me anyway). Googling the message usually revolves around web-issues (not surprisingly), with a few mentioning a web.config file. I can't see any such file in my program or SimpleTest folders (and if it's outside those project folders, then whatever it is would be the same settings for both anyway).

Any ideas on this one? Something is missing, or not configured right, but I don't know what?

 

4 Replies 4

Greg-DB
Dropbox Staff

The `System.Diagnostics.Process.Start(authorizeUri.ToString());` line is supposed to build the OAuth app authorization URL (i.e., https://www.dropbox.com/oauth2/authorize..., via `authorizeUri.ToString()`), and then have the system open it in the system web browser, whatever that may be (i.e., via `System.Diagnostics.Process.Start`). 

The SDK essentially delegates how to actually open the URL in the browser to the system, so I don't have much insight on this exception. Based on the message though, it sounds like the system is perhaps interpreting the URL as a local file location for some reason, and when it looks on the local filesystem, it can't find it, of course. To try to troubleshoot that, can you print out the value of `authorizeUri.ToString()`?

Alternatively, it may be saying it can't find the location of something else it's using, e.g., perhaps the browser itself? What system/environment are you running this in?

donaldp
Collaborator | Level 9

Hi Greg,

   Sorry - it's Visual Studio 2017 on Windows 10. I did check the string, and all is identical to SimpleTest, except for the state of course.

   Yeah, it's not openning the browser, and I'm not sure why. I had a sudden thought that maybe the system wasn't quite ready yet (just ran into this in another project) and put in a delay, but same result. It's puzzling given the very same command is working in SimpleTest, and I'm not sure what else to look at. 😞

 

Greg-DB
Dropbox Staff

I'm afraid I don't know what may be causing this. I tried looking for other reports, but I didn't find anything that quite matches this exactly. It looks like this could be due to a permissions issue though; can you try running as administrator to see if that makes any difference?

Alternatively, can you compare the References in your project with those in SimpleTest? It may be referring to not being able to find a referenced library file.

If you can reproduce this in a new simple project and share that, we'll be happy to try it here so we can troubleshoot directly.

donaldp
Collaborator | Level 9

Hi Greg,

 

Running as admin didn't fix it. I found the JS page was in my Resources folder, whereas in SimpleTest it's in the root folder. I tried moving it but that also didn't work.

 

The references look quite different, due to this being in Xamarin. In the meantime, with what I learnt from getting SimpleTest running, I managed to get THIS Xamarin solution working - http://52.57.4.83/index.php/2016/10/02/xamarin-forms-dropbox-integration-app-folder/. The approach is a little different. i.e. in this case Webview is being used rather than Httplistener, for example. I was hoping to get it working following your .NET doco, since theoreticlly it should work, and if successful then I can confidently follow your other .NET doco (I've been switching back and forth trying to get them both working, and I've succeeded with the other one first). Perhaps this is one of the limitations in Xamarin though. I'll see if I canfind out some more about that possibility from them, as, like I said, would LIKE to get this approach working if I can (I have more resources available to me if I'm able to follow your .NET doco. The Xamarin Dropbox blog I mentioned above is the only such resource I've found). I'll report back if I find out anything. Thanks for your help. 🙂

 

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    donaldp Collaborator | Level 9
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?