Quantcast
Channel: Forums - ArcObjects SDKs
Viewing all articles
Browse latest Browse all 1374

How to change license type at runtime?

$
0
0
I have this code:

Code:

        //See i EVER try to check ADVANCED License!!!
        if (ArcLicense.CheckOutExtensionLicense(ESRI.ArcGIS.esriSystem.esriLicenseProductCode.esriLicenseProductCodeAdvanced))
        {
                doc = new ESRI.ArcGIS.ArcMapUI.MxDocumentClass();
        }

My method CheckOutExtensionLicense is:

Code:

        public static bool CheckOutExtensionLicense(esriLicenseProductCode licenseProductCode)
        {
            RuntimeManager.Bind(ProductCode.Desktop);
            IAoInitialize aoInitialize = new AoInitializeClass();
            esriLicenseStatus licenseStatus = aoInitialize.IsProductCodeAvailable(licenseProductCode);

            if (licenseStatus == esriLicenseStatus.esriLicenseAvailable)
            {
                licenseStatus = aoInitialize.Initialize(licenseProductCode);
                return true;
            }
            return false;
        }

But when the ArcMap open, it opens with Basic License... I check de Arcgis Administrator and saw this configuration:
Attachment 29436

I think this configuration overrides my code, and I dont know why... Then my question, have a way to around this?
Attached Thumbnails
Click image for larger version

Name:	28-11-2013 09-45-53.png‎
Views:	N/A
Size:	27.3 KB
ID:	29436  

Viewing all articles
Browse latest Browse all 1374

Trending Articles