I thought I would start a new thread because RegisterGeodatabaseAsync and versioned data posted by John Selkirk has not seen any action for a while. I am having what would seem to be the same issue.
I am using both Desktop and Server version 10.3.1 with Sql Server. I have created a Feature Service with only one layer and I am sure this layer is versioned and does not have the "Move edits to base" option selected.
I have followed the directions here: Create an offline map—ArcGIS Runtime SDK for .NET | ArcGIS for Developers and have gone through this process multiple times.
I am able to successfully publish the feature service with all capabilities enabled. Once the feature service is published I can run the GenerateGeodatabaseAsync method without problem as describe in the link above. I use the following parameters to setup the download
var gdbParams = new GenerateGeodatabaseParameters(featureServiceInfo, extent)
{
OutSpatialReference = RuntimeControls.MapView.SpatialReference,
SyncModel = SyncModel.PerGeodatabase,
GeodatabasePrefixName = item.GdbName // = Leaks
};When using a versioned gdb, the SyncModel.PerGeodatabase is required.
After the download is completed I have the following in my SDE_versions table.
| name | owner | version_id | status | state_id | description | parent_name | parent_owner | parent_version_id | creation_time |
| DEFAULT | sde | 1 | 1 | 0 | Instance default version. | NULL | NULL | NULL | 2015-10-22 09:41:32.000 |
| Esri_Anonymous_R_1447778446330 | GIS | 50 | 0 | 0 | | DEFAULT | SDE | 1 | 2015-11-17 10:40:46.000 |
| SYNC_SEND_6317_0 | GIS | 51 | 16777216 | 0 | | Esri_Anonymous_R_1447778446330 | GIS | 50 | 2015-11-17 10:40:52.000 |
At this point I move the downloaded Leaks.geodatabase file to a new machine and run RegisterGeodatabaseAsync:
GeodatabaseSyncTask task = new GeodatabaseSyncTask(new Uri("http://id-svr003:6080/arcgis/rest/services/Runtime/Leaks/FeatureServer"));
Geodatabase gdb = await Geodatabase.OpenAsync(@C:\Mobile\Operational\Bidirectional\Leaks.geodatabase);
GeodatabaseStatusInfo info = await task.RegisterGeodatabaseAsync(gdb);This fails and the server log shows:
Error: An error occurred while adding an entry to the FEATUREDATASET_CLASSES or the FEATURECLASSES table. [Read only data or unversioned data cannot be replicated. Data versioned with the option to move edits to base cannot be replicated. GlobalIDs are required for two way and one way replica data. Creating one way replica using archiving requires archiving the replicated parent data.]. Version not found [GIS.Leaks_6317]. Version not found [GIS.Leaks_6317]. Version not found [GIS.Leaks_6317]. Version not found [GIS.Leaks_6317]. Version not found [GIS.Leaks_6317]. Version not found [GIS.Leaks_6317]. |
I have gone through this process a number of times and always get this failure on RegisterGeodatabaseAsync. It almost seems to me that it expects the version SYNC_SEND_6317_0 to be named Leaks_6317
This is a total show-stopper, it is not possible to deploy a Runtime offline application if we cannot register the databases as