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.

Is it possible to change to a "higher-level" license after a license has already been checked out in ArcGIS Engine? Old posts in ESRI forums seem to indicate that this is not possible, but I'm wondering if 9.3 or 10 allows this.

We have an application that 99%+ is used for viewing GIS data, so the ArcGIS Engine Runtime license is appropriate. Every now and then, though some (not all) users need to be able to edit an arc or two and it would be extremely annoying and disruptive to their workflow to have to exit the application and fire it up again just to grab an ArcInfo license.

share|improve this question
add comment

3 Answers

up vote 2 down vote accepted

I don't see anything in the documentation that says you cannot switch. However the code below isn't able to switch. Maybe report this as a bug and see what happens.

Update: As Michael points out, the documentation says this is not supported.

private void SwitchLicense1()
{
    if (ESRI.ArcGIS.RuntimeManager.ActiveRuntime.Product == ESRI.ArcGIS.ProductCode.Engine)
    {
        ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.Desktop);
        if (ESRI.ArcGIS.RuntimeManager.ActiveRuntime.Product == ESRI.ArcGIS.ProductCode.Engine)
            Debug.Print("unable to switch to desktop");
        else
            Debug.Print("switched to desktop license");
    }
    else
    {
        ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.Engine);
        if (ESRI.ArcGIS.RuntimeManager.ActiveRuntime.Product == ESRI.ArcGIS.ProductCode.Desktop)
            Debug.Print("unable to switch to engine");
        else
            Debug.Print("switched to desktop license");
    }
}
private void SwitchLicense2()
{
    IAoInitialize aoInit = new AoInitializeClass();
    Debug.Print("before license: {0}", aoInit.InitializedProduct());
    if (aoInit.InitializedProduct() == esriLicenseProductCode.esriLicenseProductCodeEngine)
    {
        aoInit.Shutdown();
        aoInit.Initialize(esriLicenseProductCode.esriLicenseProductCodeArcEditor);
    }
    else
    {
        aoInit.Shutdown();
        aoInit.Initialize(esriLicenseProductCode.esriLicenseProductCodeEngine);
    }
    Debug.Print("after license: {0}", aoInit.InitializedProduct());
}
share|improve this answer
    
that did not do the trick? I never tried this as you, but I imagined that you'd be able to do that without further worries, –  George Sep 29 '10 at 17:52
    
Thanks, Kirk. I was trying to avoid the "let's see if I can get this to work" approach, but if it didn't work for you, I'm not likely to have any luck. I'll take your code and submit a bug if I can't get it to work. –  Michael Todd Sep 29 '10 at 17:58
add comment

Per ESRI technical support, no, you cannot switch licenses mid-stream. This holds true for version 9.3.1 as well as 10 (and I'm assuming prior versions as well).

On a related note, this holds true for ArcMap and ArcCatalog, as well. You'd need to exit those applications if you want to switch from an ArcView to an ArcInfo license.

UPDATE: ESRI called me back a few minutes after hanging up with me to tell me that the first tech was wrong and that you can switch licenses mid-stream in Engine (though not when using ArcMap). However, the information the second tech provided (actually, she was an SDK programmer) is exactly the same steps I was using to try to switch licenses, so, again, this appears to be something that is either broken or doesn't work as they had intended. I'll submit a bug report and see if anything comes of it.

Final update: Per the documentation, it is not possible to reinitialize an application with a new license:

Initialize the application with the product license

Once it has been established that the appropriate product and extension licenses are available, initialize the application with the product license. Once initialized, it is not possible to reinitialize the application.

This is not a bug, this is expected behavior. And unfortunate.

share|improve this answer
add comment

Yes you can do that.

Using the interface IAOInitialize you can try to check out higher licenses when you need it, and check then in when you don't. Same can happen with Extensions.

share|improve this answer
    
I'm currently using the license control (which doesn't appear to have properties or methods to handle switching). Is it "easy" to switch from using the license control to using IAOInitialize? –  Michael Todd Sep 29 '10 at 17:21
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.