AnsweredAssumed Answered

GeodatabaseSyncTask Download Geodatabase Error

Question asked by ArborBandricks on Aug 17, 2017

I'm trying to download a geodatabase using xamarin C#, when I run the task, I get the following error returned:

 

"File exception: The supplied file path is to an existing directory, it must be a path to file."

 

Why would a new geodatabase need to be a path to a file? Shouldn't it in fact need a directory path? Confused on what to make if this error. 

 

Sample of some of my code doing this: 

//using this as the URI for testing
var featureTableUri = new System.Uri("http://sampleserver6.arcgisonline.com/arcgis/rest/services/Sync/SaveTheBaySync/FeatureServer");

//code of how I'm getting the output path for the GDB
var outputBasePath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
var outputPathFinal = Path.Combine(outputBasePath, "newGDB");

//here is where I'm set up generating GDB job
var generateGdbJob = gdbSyncTask.GenerateGeodatabase(generateGdbParams, outputPathFinal);

//this is where I star the job
generateGdbJob.JobChanged += OnGenerateGdbJobChanged;
generateGdbJob.Start();

//below is the part that is returning the error (so I know it's from the server service)
private void OnGenerateGdbJobChanged(object sender, EventArgs e)
        {
           var job = sender as GenerateGeodatabaseJob;

           if (job.Error != null)
            {
              Console.WriteLine("Error creating geodatabase: " + job.Error.Message);
              return;
            }
}

//the job.Error.Message is where I'm getting the error I'm not sure of...

Outcomes