ArcGIS Pro 3.1 API Reference Guide
ArcGIS.Core.Data Namespace / VersionManager Class / CreateVersion Method / CreateVersion(VersionDescription) Method
The VersionDescription that specifies what the version should look like.
Example

In This Topic
    CreateVersion(VersionDescription) Method
    In This Topic
    Creates a new Version. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Overloads Function CreateVersion( _
       ByVal versionDescription As VersionDescription _
    ) As Version

    Parameters

    versionDescription
    The VersionDescription that specifies what the version should look like.
    Exceptions
    ExceptionDescription
    versionDescription is null.
    The VersionDescription.Name value in versionDescription is null or an empty string.
    The VersionDescription.AccessType value in versionDescription is invalid.
    A geodatabase-related exception has occurred.
    This method or property must be called within the lambda passed to QueuedTask.Run
    Example
    Creating a Version
    public Version CreateVersion(Geodatabase geodatabase, string versionName, string description, VersionAccessType versionAccessType)
    {
      if (!geodatabase.IsVersioningSupported()) return null;
    
      using (VersionManager versionManager = geodatabase.GetVersionManager())
      {
        VersionDescription versionDescription = new VersionDescription(versionName, description, versionAccessType);
        return versionManager.CreateVersion(versionDescription);
      }
    }
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.0 or higher.
    See Also