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 at a complete loss... I have a Server 10.0 license on my machine but the following code fails:

if (ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.Server) == false)
    throw new Exception("License Failed");

MapServerClass mapServer = new MapServerClass();
mapServer.Connect(pathToMap); // Fails! 

ComException was unhandled

MapServer is not supported with the current license.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Figured it out immediately after asking this... funny how that works.

Solution:

IAoInitialize aoInit = new AoInitializeClass();
aoInit.Initialize(esriLicenseProductCode.esriLicenseProductCodeArcServer);
share|improve this answer
    
go ahead and mark your answer as accepted. –  Kirk Kuykendall Sep 26 '11 at 13:27
    
@Kirk Still waiting the minimum 2 days before accepting –  tbridge Sep 26 '11 at 16:49

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.