[solved] Argument out of range exception on SynchronizeFolder()

Aug 9, 2012 at 3:54 PM


i try to synchronize a local folder with dropbox, but i run into a problem with an ArgumentOutOfRange exception. Dose anyone know a solution for this failure?

Two folders, one on my local disk, on in dropbox.

If the local folder contains a file, that is not available in the dropbox folder, the synchronize copys the file correct into dropbox. If a file exists only in dropbox and not in the local folder, the Synchronize() method throws an argument out of range exception. I tried to sync a HelloWorld.txt file ...


        public void SyncFolder(SaveGameFolder folder)
            ICloudDirectoryEntry root = _dropBoxStorage.GetRoot();

            bool folderExist = root.FileSystemEntryExits(folder.GameName);

            if (!folderExist)
                ICloudDirectoryEntry entry = _dropBoxStorage.GetRoot();
                _dropBoxStorage.CreateFolder(folder.GameName, entry);

            ICloudDirectoryEntry gameFolder = _dropBoxStorage.GetFolder(folder.GameName, root);
            DirectoryInfo info = new DirectoryInfo(folder.FolderPath);

            _dropBoxStorage.SynchronizeFolder(info, gameFolder, CloudStorage.SyncFolderFlags.Synchronize);





   at System.Linq.Enumerable.ElementAt[TSource](IEnumerable`1 source, Int32 index)
   at AppLimit.CloudComputing.SharpBox.SyncFramework.DirectoryDiff.Compare(Boolean bRecursive)
   at AppLimit.CloudComputing.SharpBox.CloudStorage.SynchronizeFolder(DirectoryInfo srcFolder, ICloudDirectoryEntry tgtFolder, SyncFolderFlags flags)
   at SaveGameCloud.Logic.DropBoxHandler.UploadFolder(SaveGameFolder folder) in C:\Users\MyUser\documents\visual studio 2010\Projects\SaveGameCloud\SaveGameCloud\Logic\DropBoxHandler.cs:Line 91.
   at SaveGameCloud.Test.DropBoxHandlerTest.UploadFolderTest() in C:\Users\MyUser\documents\visual studio 2010\Projects\SaveGameCloud\SaveGameCloud.Test\DropBoxHandlerTest.cs:Line 122.


Line 91 is the SyncronizeFolder() call;

Aug 9, 2012 at 7:05 PM


could you please tell me which version are you using, im been trying to get open connection but i got erroe saying "Attempted to perform an unauthorized operation."

here is my code:

   static void Main(string[] args)        {       

    // Creating the cloudstorage object           

CloudStorage dropBoxStorage = new CloudStorage();
            // get the configuration for dropbox          

  AppLimit.CloudComputing.SharpBox.StorageProvider.DropBox.DropBoxConfiguration dropBoxConfig = AppLimit.CloudComputing.SharpBox.StorageProvider.DropBox.DropBoxConfiguration.GetStandardConfiguration();
          //  DropBoxConfiguration dropBoxConfig = CloudStorage.GetCloudConfigurationEasy(nSupportedCloudConfigurations.DropBox) as DropBoxConfiguration;                       // declare an access token           

ICloudStorageAccessToken accessToken = null;                      

// load a valid security token from file         

  using (FileStream fs = File.Open(@"C:\token.txt", FileMode.Open, FileAccess.Read, FileShare.None))           

{                accessToken = dropBoxStorage.DeserializeSecurityToken(fs);               

// Open connection to Dropbox
                //ICloudStorageAccessToken storageToken = dropBoxStorage.Open(dropBoxConfig, accessToken);
                // Serialize the token to disk               



var storageToken = dropBoxStorage.Open(dropBoxConfig, accessToken);


Please help.






Aug 10, 2012 at 7:09 AM

You should open an own thread for your question. Your reply dose not solve my reported problem ...

Aug 10, 2012 at 7:52 AM

I found a solution on the sourcecode -> patches screen. The checkin 11540 solved the issue for me.