AnsweredAssumed Answered

Error Message: System.InvalidCastException: Unable to cast COM object of type 'ESRI.ArcGIS.esriSystem.AoInitializeClass'

Question asked by jsn on Jun 21, 2017

Hello everyone,

 

I upgraded my local ArcGIS Server from version 10.2.2 to version ArcGIS Server 10.3 and after rebuilding a VS 2012 VB.Net web service, it shows the following error message. Then I uninstalled ArcGIS Server 10.3 and installed ArcGIS Server 10.2.2 and I got again the same error message.

 

Please help!!!

 

 

System.InvalidCastException: Unable to cast COM object of type 'ESRI.ArcGIS.esriSystem.AoInitializeClass' to interface type 'ESRI.ArcGIS.esriSystem.IAoInitialize'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{9AB6A638-ACA8-4820-830C-463EA11C8722}' failed due to the following error: Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED)).
at ESRI.ArcGIS.esriSystem.AoInitializeClass.IsProductCodeAvailable(esriLicenseProductCode ProductCode)
at LicenseInitializer.Initialize() in C:\Workspace\IncidentV10.2\Incident\App_Code\LicenseInitializer.Designer.vb:line 211
at LicenseInitializer.InitializeApplication(esriLicenseProductCode[] productCodes, esriLicenseExtensionCode[] extensionLics) in C:\Workspace\IncidentV10.2\Incident\App_Code\LicenseInitializer.Designer.vb:line 51
at GISCallCenterIncident..ctor() in C:\Workspace\IncidentV10.2\Incident\App_Code\GISCallCenterIncident.vb:line 678

 

 

Found the line where the source program fails: LicenseInitializer.Designer.vb 

 

Private Function Initialize() As Boolean

If RuntimeManager.ActiveRuntime Is Nothing Then Return False

If m_requestedProducts Is Nothing OrElse m_requestedProducts.Count = 0 Then Return False

Dim currentProduct As esriLicenseProductCode = New esriLicenseProductCode

Dim productInitialized As Boolean = False

m_requestedProducts.Sort()

If Not InitializeLowerProductFirst Then 'Request license from highest to lowest

m_requestedProducts.Reverse()

End If

m_AoInit = New AoInitializeClass()

For Each prodNumber As Integer In m_requestedProducts

Dim prod As esriLicenseProductCode = CType(System.Enum.ToObject(GetType(esriLicenseProductCode), prodNumber), esriLicenseProductCode)

Dim status As ESRI.ArcGIS.esriSystem.esriLicenseStatus

status = m_AoInit.IsProductCodeAvailable(prod)          ************************ IT FAILS HERE

 

 

 

Unable to cast COM object of type 'ESRI.ArcGIS.esriSystem.AoInitializeClass'
 to interface type 'ESRI.ArcGIS.esriSystem.IAoInitialize'.
This operation failed because the QueryInterface call on the COM component for the interface with IID
'{9AB6A638-ACA8-4820-830C-463EA11C8722}' failed due to the following error:
Library not registered

Outcomes