Question

I have a problem of opening a dropbox folder. It a code that generates an exe. Basically when the exe is executed, it starts to download a package stored in a dropbox folder. Here is my code:

    _storage = new CloudStorage();

    var dropBoxCredentials = new DropBoxCredentials();

    dropBoxCredentials.ConsumerKey = "xxxxxxxxxxxxxxx";
    dropBoxCredentials.ConsumerSecret = "xxxxxxxxxxxxxxx";

    dropBoxCredentials.UserName = "someusername";
    dropBoxCredentials.Password = "somepassword";

    DropBoxConfiguration configuration = DropBoxConfiguration.GetStandardConfiguration();

    //open the dropbox connection
    _storage.Open(configuration, dropBoxCredentials);

I am sorry that I have to hide the confidential information, but I assume they are correct. So the problem occurs at _storage.Open(configuration, dropBoxCredentials); It says: ![enter image description here][1]

I checked the "configuration" and "dropBoxCredentials", and they are not Null, and so is "_storage". So I am confused, what is the problem here exactly? Thanks a lot.

Edit; Here is the stack trace:

at AppLimit.CloudComputing.SharpBox.StorageProvider.DropBox.DropBoxToken..ctor(OAuthToken token, DropBoxBaseCredentials baseCreds)
at AppLimit.CloudComputing.SharpBox.StorageProvider.DropBox.Logic.DropBoxStorageProviderService.AuthorizeAndGetSession(DropBoxCredentials credentials, DropBoxConfiguration configuration)
at AppLimit.CloudComputing.SharpBox.StorageProvider.DropBox.Logic.DropBoxStorageProviderService.Authorize(DropBoxCredentials credentials, DropBoxConfiguration configuration)
at AppLimit.CloudComputing.SharpBox.StorageProvider.DropBox.Logic.DropBoxStorageProviderService.CreateSession(ICloudStorageCredentials credentials, ICloudStorageConfiguration configuration)
at AppLimit.CloudComputing.SharpBox.StorageProvider.GenericStorageProvider.Open(ICloudStorageConfiguration configuration, ICloudStorageCredentials credentials)
at AppLimit.CloudComputing.SharpBox.CloudStorage.Open(ICloudStorageConfiguration configuration, ICloudStorageCredentials credentials)
at WebUpdater.Program.Main(String[] args) in C:\\TIS\\Tools\\WebUpdater\\WebUpdater\\Program.cs:line 52
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Was it helpful?

Solution

The stack trace shows that the exception is originating from inside the SharpBox assembly.

A NullReferenceException always indicates some kind of bug and as such you should consider creating an issue on the SharpBox website.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top