Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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
 initialization.

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

share|improve this question
add comment

1 Answer 1

up vote 0 down vote accepted

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.

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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