i am using arcgis server 10 and visual studio with vb.net to build web mapping application. inside my code i have the following line:

Dim RasterCal As ESRI.ArcGIS.SpatialAnalyst.IMathOp = _
   New ESRI.ArcGIS.SpatialAnalyst.RasterMathOpsClass

or even if i do it this way

Dim RasterCal As ESRI.ArcGIS.SpatialAnalyst.IMathOp = _
   New ESRI.ArcGIS.SpatialAnalyst.RasterMapAlgebraOp

in both cases i get initialization error which says:

The runtime application type must be specified before license

plz can you tell me what is wrong with the above examples of lines? thanks!


You probably want to create the objects on the ArcGIS Server SOC, so you most likely need to create ArcObjects via IServerContext.CreateObject. See Working with server contexts for more details.

If you really want to create ArcObjects on the application server or web server, you first need to bind to the desired runtime via RuntimeManager.Bind. See the Runtime Binding Requirement section.

Since you are using Spatial Analyst specific classes, you will also need to checkout the Spatial Analyst extension license. More on this, along with an example, can be found here.

  • The following line worked for me... Dim pMathOp As IMathOp = iServerContext.CreateObject("esriSpatialAnalyst.RasterMathOps") thanks all! – thm Jul 28 '11 at 19:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.