Using ArcObjects 10.2.2 in standard .Net Web Service

314
0
04-20-2018 07:23 AM
JoseSanchez
Occasional Contributor III

Hello everyone,

 Environment:

  • ArcGIS Desktop 10.2.2
  • ArcGIS Server 10.2.2
  • VS 2010 or VS 2012
  • Application Pool: Set to True, Enable 32-bit applications property in IIS app pool.
  • Error message: 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))
  • Already applied https://community.esri.com/message/64797

I created a standard web service using VB.Net and VS 2010, in ArcGIS 10.2. then I added ArcGIS references:

Imports ESRI.ArcGIS.esriSystem

to the Vb.Net Web Service project:

           ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.Server)

           m_AOInit = New AoInitializeClass()

          Dim licenseStatus As esriLicenseStatus = m_AOInit.Initialize (esriLicenseProductCode.esriLicenseProductCodeArcServer)       *****************  THIS LIE RETURNS THE ERROR MESSAGE BELOW: 

 

I ran the web service in Debug mode and it fails when it reaches the following line:

Dim licenseStatus As esriLicenseStatus = m_AOInit.Initialize(esriLicenseProductCode.esriLicenseProductCodeArcServer)

 with error message:

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))

 

Please download zip file that contains a standard vb.net web service where I added these 3 lines in the Hello World method, and now it returns the error message.

Any suggestion? Thanks in advance!

0 Kudos
0 Replies