Hello
I am working with ArcGIS Pro 3.3 and I am trying to build an addin in order to export in a file (txt/csv/xls) the conflicts that may occur during a reconcile bewteen two versions in my geodatabase. In ArcGIS Pro, the "Conflicts View" panel contains all the information that I want, but couldn't find a way to export it's content. That's why I am developping my own addin.
So, I used this piece of code in order to do the reconcile (and then later in case of conflicts export the listing). But I am facing the following error : Error code 160362 when reaching the "currentVersion.Reconcile" on line 20 :
if (geodatabase.IsVersioningSupported())
{
using (VersionManager versionManager = geodatabase.GetVersionManager())
using (ArcGIS.Core.Data.Version currentVersion = versionManager.GetCurrentVersion())
using (ArcGIS.Core.Data.Version parentVersion = currentVersion.GetParent())
{
Debug.WriteLine($"Reconcile on {geodatabase.GetPath()}:\n{parentVersion.GetName()} => {currentVersion.GetName()}");
Debug.WriteLine($"Current version : {currentVersion.GetName()}");
Debug.WriteLine($"Parent version : {parentVersion.GetName()}");
ReconcileOptions reconcileOptions = new ReconcileOptions(parentVersion);
reconcileOptions.ConflictResolutionMethod = ConflictResolutionMethod.Abort;
reconcileOptions.ConflictDetectionType = ConflictDetectionType.ByColumn;
reconcileOptions.ConflictResolutionType = ConflictResolutionType.FavorEditVersion;
reconcileOptions.ServiceSynchronizationType = ServiceSynchronizationType.Synchronous;
Debug.WriteLine($"Conflits before reconcile: {currentVersion.HasConflicts()}");
ReconcileResult reconcileResult = currentVersion.Reconcile(reconcileOptions);
if (reconcileResult.HasConflicts)
{
Debug.WriteLine("Conflits after reconcile !");
}
else
{
Debug.WriteLine("No conflits !");
}
if (Project.Current.HasEdits) {
await Project.Current.DiscardEditsAsync();
Debug.WriteLine("Rollback done!");
}
else
{
Debug.WriteLine("No pending edits");
}
}
}
At first I thought my database was too old, as I'm still using traditionnal versioning, but I made another test on a database with branch versioning this time (with data accessed through a FeatureServer), and got the same error.
The code works fine when there are no conflicts bewteen my 2 versions. But when I create one conflict on purpose, I get the error. Do you have a clue what I might be doing wrong in my code ?
Thanks,
Matthias