ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Core Namespace / GeneralOptions Class / PortalProjectDeleteLocalCopyOnClose Property
Example

In This Topic
    PortalProjectDeleteLocalCopyOnClose Property
    In This Topic
    Gets and sets whether the downloaded local copy of a portal project is preserved when you close the project.
    Syntax
    public bool PortalProjectDeleteLocalCopyOnClose {get; set;}
    Public Property PortalProjectDeleteLocalCopyOnClose As Boolean
    Remarks
    The local copy (also called the cached copy) contains the changes you make to a portal project after downloading it. These changes are uploaded to the portal when you save the project.
    Example
    Portal Project Options
    // access the current options
    var def_home = ApplicationOptions.GeneralOptions.PortalProjectCustomHomeFolder;
    var def_gdb = ApplicationOptions.GeneralOptions.PortalProjectCustomDefaultGeodatabase;
    var def_tbx = ApplicationOptions.GeneralOptions.PortalProjectCustomDefaultToolbox;
    var deleteOnClose = ApplicationOptions.GeneralOptions.PortalProjectDeleteLocalCopyOnClose;
    var def_location = ApplicationOptions.GeneralOptions.PortalProjectDownloadLocation;
    
    
    // set the options
    ApplicationOptions.GeneralOptions.PortalProjectCustomHomeFolder = @"E:\data";
    ApplicationOptions.GeneralOptions.PortalProjectCustomDefaultGeodatabase = @"E:\data\usa.gdb";
    ApplicationOptions.GeneralOptions.PortalProjectCustomDefaultToolbox = @"E:\data\usa.tbx";
    ApplicationOptions.GeneralOptions.PortalProjectDeleteLocalCopyOnClose = false;
    ApplicationOptions.GeneralOptions.PortalProjectDownloadLocation = @"E:\data";
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.4 or higher.
    See Also