ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Core Namespace / Project Class / SaveAsync Method
Example

In This Topic
    SaveAsync Method
    In This Topic
    Saves the project
    Syntax
    public Task<bool> SaveAsync()
    Public Function SaveAsync() As Task(Of Boolean)

    Return Value

    A Task returning an indication if the operation was successful or not; true if the save operation succeeds
    Exceptions
    ExceptionDescription
    The save location can not be found or accessed
    The save location may be on a full disk
    There was an unspecified write error while saving
    There was an unspecified error while saving
    Portal project is read-only
    Remarks

    The project file (*.aprx) stored on disk is replaced by a new version of the file representing the current state of the project. For example, this ensures the maps and layouts you created will be available the next time you open this project. Data displayed in a map is not saved in the project; the connections used to access the data are saved.

    Saving the project requires write access to the location where the project is stored. If another person is using the same project file at the same time, saving your changes will not succeed.

    Attempting to save a portal project that is read only will throw a System.InvalidOperationException. Addins should check the ReadOnly property to ensure that the project can be saved.

    Example
    Save project
    //Saves the project
    await Project.Current.SaveAsync();
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also