AnsweredAssumed Answered

Class not registered Exception from HRESULT 0x80040154 REGDB_E_CLASSNOTREG

Question asked by reneefhartless on Jan 18, 2013
Latest reply on Jan 23, 2013 by reneefhartless
I am in the process of converting a webservice from 10 to 10.1.  The development machine is a 32 bit and the server is a 64 bit machine.  I set the target to any CPU in Visual Studio 2010.  When I check the temp folders I see on the 64 bit machine that the following folder is the one getting written to \Framework64\v4.0.30319\Temporary ASP.NET Files.  This makes me think that it is indeed running as 64 bit, but I am not sure.  I understand that I can no longer use AGSServerConnection to access arcobjects because DCOM connections to arcgis server are not supported and I am trying to resolve that.  I have seen the few forum threads that discuss this and I am still not sure how to resolve.  I have commented out all the code since we used that every where and I am only trying to run the following lines as an alternative to get to the arcobjects:

Type factoryType = Type.GetTypeFromProgID("esriDataSourcesGDB.SdeWorkspaceFactory");
IWorkspaceFactory pSdeFact = (IWorkspaceFactory)Activator.CreateInstance(factoryType);

The first line by itself runs fine but when I add the second I get the following error:

Retrieving the COM class factory for component with CLSID D9B4FA40-D6D9-11D1-AA81-00C04FA33A15 failed due to the following error 80040154 Class not registered Exception from HRESULT 0x80040154 REGDB_E_CLASSNOTREG .

I am running this on Windows Server 2008 R2 Enterprise with SP1.  Installed on this machine is desktop 10.1, server 10.1 with SP1, and 10.1 Web ADF Runtime for the framework.  I am targeting the 4.0 framework and I do have the 3.5 SP1 service pack installed.  When I look in the C:\Windows\assembly folder I see all the 10.1 ESRI dll's.

We do not do too much with this webservice.  The final tasks that I am trying to accomplish are: Create a feature in SDE, Update an SDE feature and export an SDE Feature class to shapefile or file geodatabase using filters to get only desired records and field mapping to remove some columns so that data is not included in the export.  We also have a tool that just checks to make sure everything is up and running so the listed tasks can be performed.

What I want to know is why am I getting this error?  Could it be because I need to build the webservice on a 64 bit machine or is a 32 bit machine with the correct target (Any CPU) set in VS ok?

Is there a better way to accomplish what I am trying to do?  I have read about the SOE files but I am trying not to have to rewrite everything as we have limited time and budget to perform this conversion.

Any help is much appreciated.  Thank-you!