ClassFactory cannot supply requested class error with AGS Spatial Ref

10970
10
06-13-2012 12:49 PM
IanKramer
New Contributor III
Hi Everybody,
I am writing a .NET WCF 3.5 REST service and I am getting a weird error when trying to create a projected coordinate system:

[System.Runtime.InteropServices.COMException] = {"ClassFactory cannot supply requested class (Exception from HRESULT: 0x80040111 (CLASS_E_CLASSNOTAVAILABLE))"}

The problem error exists when I call the following line: inSpatRef = inSpatRefFact.CreateProjectedCoordinateSystem(102100);

ISpatialReferenceFactory2 inSpatRefFact = sc.CreateObject("esriGeometry.SpatialReferenceEnvironment") as ISpatialReferenceFactory2;
ISpatialReference inSpatRef = sc.CreateObject("esriGeometry.ProjectedCoordinateSystem") as ISpatialReference;
inSpatRef = inSpatRefFact.CreateProjectedCoordinateSystem(102100);

I am using the AGSServerConnection:

agsconn = new ESRI.ArcGIS.ADF.Connection.AGS.AGSServerConnection(System.Configuration.ConfigurationManager.AppSettings["AgsServer"], id);
agsconn.Connect();
if (!agsconn.IsConnected)
{
agsconn.Dispose();
return "Server Connection Failed";
}

ESRI.ArcGIS.Server.IServerObjectManager som = agsconn.ServerObjectManager;
sc = som.CreateServerContext("MyFolder/MyMapService", "MapServer");

Any ideas?

Thanks!

Ian
0 Kudos
10 Replies
LisaT
by
Occasional Contributor III

I am trying to use the geoprocessing tools "StageService" and "UploadServiceDefinition" and I get this error when looking at the geoprocessing results window.  A google on it seems to point to the installation of the .NET Extensions when running the ArcGIS Server Setup.  I've messed with trying to uninstall/reinstall and am still having issues.  So...obviously not related to custom code.

0 Kudos