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

Aug 9, 2012 at 4:54 PM

Hi,

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

        }

 

 

StackTrace:

   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 8:05 PM

Hi,

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               

//dropBoxStorage.SerializeSecurityToken(dropBoxConfig,accessToken);         

  }                           

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

}

Please help.

 

Thanks

 

 

 

Aug 10, 2012 at 8:09 AM

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

Aug 10, 2012 at 8:52 AM

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