English

How To: Remove a feature class extension from a geodatabase

Summary

In a scenario where a feature class extension is created on Computer A (which has ArcGIS Desktop installed), users follow this two-step workflow:

  1. Register the class extension's DLL with ArcGIS Desktop.
  2. Apply the class extension programmatically to a particular feature class, using: 
    IClassSchemaEdit2.AlterClassExtensionCLSID(extUID, extensionProperties)
    This is based on the ArcObjects .NET Web Help documentation, Creating class extensions.
On a secondary computer or virtual machine (Computer B) with ArcGIS Desktop installed, it is challenging to remove the class extension on the enterprise geodatabase from this other computer because it is not the machine from which the feature class extension was registered. Attempts to programmatically apply the following code to remove the class extension (using an Engine Console App, or ArcMap add-in) are unsuccessful:
classSchemaEdit.AlterClassExtensionCLSID(null, null)
This is because ArcGIS Desktop or Engine must be registered with the class extension before it can be removed. The instructions provided describe how to remove a feature class extension from a geodatabase.

Procedure

  1. Copy the class extension DLL to the new computer, and register it by running EsriRegAsm.exe against Desktop or Engine.
  2. Connect to the enterprise geodatabase (using a Direct Connect SDE connection) that contains the feature classes that have the associated class extension and programmatically remove the class extension by calling the following code:
    classSchemaEdit.AlterClassExtensionCLSID(null, null)
    The above line of code can be called from a standalone console application, or an ArcMap add-in OnClick event.
  3. Unregister the class extension using EsriRegAsm against Desktop or Engine.
  4. Create a new class extension in Visual Studio and follow the aforementioned two-step workflow to enable the class extension on the same feature classes.
    1. Register the new class extension with ArcGIS Desktop or Engine
    2. Apply the class extension to one or more feature classes using a console or desktop application by executing: 
      IClassSchemaEdit2.AlterClassExtensionCLSID(extUID, extensionProperties)

Related Information