bkirchhoff

How do you unregister a "lost" workspace extension?

Discussion created by bkirchhoff on Sep 14, 2011
There's probably a very simple solution to this...

I created a workspace extension a while back and used geodatabase registration to associate it with a geodatabase.  The extension has been superceded and its code has been removed from the system.  The geodatabase that has the extension is now unreachable.  When I try to list the extensions for the geodatabase using the following code:

Dim pExtMgr as IWorkspaceExtensionManager = Ctype(targetWS, IWorkspaceExtensionManager)
Dim i as integer = pExtMgr.ExtensionCount

I get a COMexception at the ExtensionCount line with the following message:

Failed to instantiate the workspace extension COM component. <Project>.<Class> <ClassID> at IworkspaceExtensionmanager.get_ExtensionCount()...

I have tried ESRI's suggested method for unregistering:

Dim uid as UID = New UIDClass
UID.value = extensionUID  '... from the error message
Dim extMgr as IworkspaceExtensionManager = Ctype(workspace, IworkspaceExtensionManager)
ExtensionManager.UnregisterExtension(uid)

and it runs without error, but when I then go back and list the geodatabase's extensions I get the same error as above - COMException at the ExtensionCount method of IworkspaceExtensionManager.

I could go back and reinstall the older version of the software and then try unregistering, but you might not always have a previously asociated workspace extension for a geodatabase - so how would you go about "freeing" the geodatabase of the "lost" extension?

I working in ArcGIS 10.2, on Win7 with VB.Net 3.5, VS2010.

Outcomes