3

I'm writing an application using ArcObjects. I initialize the license with code similar to this:

var extensionCodes = new[] {
    esriLicenseExtensionCode.esriLicenseExtensionCodeNetwork,
    esriLicenseExtensionCode.esriLicenseExtensionCodeSpatialAnalyst
};

lic = new AoInitialize();
lic.Initialize(esriLicenseProductCode.esriLicenseProductCodeAdvanced)
foreach (var ext in extensionCodes) {
    lic.CheckOutExtension(ext);
}

(I have more result checking and error handling in my actual code, as well as a pre-check for availability.)

All the samples and documentation I can find say to use Shutdown to release the licenses:

lic.Shutdown();

But none of the examples I could find used extensions. Is Shutdown enough to release them back to the license server, or do I need to check those back in explicitly like so:

foreach (var ext in extensionCodes) {
    lic.CheckInExtension(ext);
}

I'm using ArcGIS 10.3.1 currently, but I would like to know if previous versions are known to be different.

4

According to the help docs, it is probably safest to do both by explicitly checking the license in with the extension code and then calling lic.Shutdown() depending on how you're checking out the license. From the help:

The way that the extensions are checked in and out will depend on the type of product license passed to the Initialize method.

If the application was initialized with either of the Engine Single Use licenses, any extensions used by the application will also be Engine Single Use. As such any extensions can be checked out directly after the application is initialized and checked back in before Shutdown.

If the application was initialized with a license server and the extensions are required by the application for it to run successfully, the extensions should be checked out directly after the application is initialized and checked back in before Shutdown.

If the application was initialized with a license server and the extension functionality is not necessary for the application to function, the extensions can either be checked out directly after the application is initialized or checked out as and when the extension functionality is required. When the extension is checked in the functionality should be disabled. Use the IsExtensionCheckedOut method determines whether the extension is already checked out.

  • 1
    Thanks! That sounds like a pretty definitive, "Yes, I need to check them in explicitly," to me. I wasn't able to find that documentation. Btw, your link has an extra %20http:// that makes it not directly clickable. – jpmc26 Jan 9 '16 at 1:23

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.