ICloudStorageAccessToken Open表示Null引用

时间:2013-05-02 14:28:18

标签: c# dropbox sharpbox

我遇到打开Dropbox文件夹的问题。它是一个生成exe的代码。基本上,当执行exe时,它开始下载存储在dropbox文件夹中的包。这是我的代码:

    _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);

我很抱歉我必须隐藏机密信息,但我认为它们是正确的。所以问题出现在_storage.Open(configuration, dropBoxCredentials);它说: ![在此输入图像说明] [1]

我检查了“configuration”和“dropBoxCredentials”,但它们不是空的,“_storage”也是如此。 所以我很困惑,这到底是什么问题?非常感谢。

编辑;这是堆栈跟踪:

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()

1 个答案:

答案 0 :(得分:1)

堆栈跟踪显示异常源自SharpBox程序集内部。

NullReferenceException总是表示某种错误,因此您应该考虑在SharpBox网站上创建问题。