Select to view content in your preferred language

Error creating Geodatabase Version ArcGis pro c#

106
0
07-24-2025 10:40 AM
Labels (1)
JuanManuelPazDiaz
New Contributor

Good morning, I am generating a connection to a service where I have my layers hosted,
everything is correct, but when I try to generate a new version,
it shows me the following error: "User does not have privileges to perform this operation." I have already changed the user to one with privileges.
To confirm that the user is correct,
I tried directly from the ArcGis Pro interface and it does allow me to generate versions without any errors.
I don't know if I need to take any other steps.

This is my code

private void Create_Version()
{
try
{
Uri nonFederatedServerURL = new Uri("https://procesos/FeatureServer");
ServiceConnectionProperties nonFederatedArcGISServer = new ServiceConnectionProperties(nonFederatedServerURL)
{
User = "prueba",
Password = "prueba2"
};
using (Geodatabase geodatabase = new Geodatabase(nonFederatedArcGISServer))
{
if (geodatabase.IsVersioningSupported())
{
// Create a VersionDescription object
VersionDescription versionDescription = new VersionDescription("VERSIONPRUEBA", "DESDECODIGO", VersionAccessType.Public);

// Get the current version as the parent (or specify a different parent if needed)
ArcGIS.Core.Data.Version parentVersion = geodatabase.GetVersionManager().GetCurrentVersion();
ArcGIS.Core.Data.Version newVersion = geodatabase.GetVersionManager().CreateVersion(versionDescription, parentVersion);
}
}
}
catch (Exception ex)
{
MessageBox.Show("error" + ex.Message + " " , "", MessageBoxButton.OK, MessageBoxImage.Information);
}
}

Thank you, I hope you can support me.


 

0 Kudos
0 Replies