Standalone Orphan Verison Cleanup tool not deleting Design versions

Version 4

    Behavior


    Designer does not properly delete orphaned designs versions when a custom standalone Orphan Version Cleanup tool (OVCT) is used and run (outside of ArcCatalog).

     

    Cause


    The Process Framework Workspace is not set when run outside ArcCatalog. The custom standalone application must set the workspace as is required by the Design deleter. A custom extension can be created to do this.


    Solution

     

    The first snippet below is the code which must be added to the standalone Orphan Version Cleanup tool project sampled found here: Sample - Automated Cleanup

    The below code loads a custom extension (second snippet and attached to this post) properly setting the workspace. This should allow Designs to be deleted when run outside ArcCatalog.

     

    //Create our dummy login connection extension so that the OOTB design deleter
    //works as expected.  This gives the product code an extension with the
    //"MMPropertiesExt" name to grab a workspace from in a specific area of the
    //design deleter OOTB code.
    
    
    IExtensionManager pExtMan = Activator.CreateInstance(Type.GetTypeFromProgID("esriSystem.ExtensionManager")) as IExtensionManager;
    IExtensionManagerAdmin pExtManAdmin = pExtMan as IExtensionManagerAdmin;
    
    UID OVCLoginExtUID= new UID();
    OVCLoginExtUID.Value = "{49b246c0-2d1a-4c98-9a72-bb2681e4bce9}";
    object obj = workspace as object;
    pExtManAdmin.AddExtension(OVCLoginExtUID, ref obj);
    
    // You will want to add the above code after the following lines from the sample which retrieve the geodatabase:
    
    IWorkspace workspace = GetWorkspace();
    
    
    if (workspace == null)
    {
        ProcessMessage("Could not connect to the Geodatabase! Exiting application.");
        return;
    }
    
    
    
    
    
    

     

    The custom extension is attached and must be either included with the custom OVCT project or as a separate register-able assembly. If the ladder approach is taken, the extension must be properly registered with regx (ArcFM Desktop Developer Guide)