views:

61

answers:

1

I have just deployed an AGS-based application to our web server. This app worked great in development, but after deployment to the server I get the following errror:

Unable to cast COM object of type 'System.__ComObject' to interface type 'ESRI.ArcGIS.Carto.IMapServerObjects'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{651521F3-AAFF-42B9-8C2D-1980625A13BF}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

The C# code generating this error is:

IServerContext context = som.CreateServerContext(ConfigurationManager.AppSettings["mapService"], "MapServer");
IMapServer mapServer = (IMapServer)context.ServerObject;
IMapServerObjects serverObjects = (IMapServerObjects)mapServer;

For some reason, the IMapServer instance cannot be casted to IMapServerObjects. What could be wrong?

A: 

The solution is to deploy the map service as an MXD. The MSD only supports a subset of ArcObjects.

nw

related questions