How to 'Unbind' from a licence without closing standalone application

445
4
08-17-2011 08:25 PM
RobEllis
New Contributor
I have written an application that gives users access to many functions, some of which employ ArcGIS functionality (like processing rasters etc). I am able to 'bind' to an ArcGIS instance and license just fine with:

        ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.EngineOrDesktop)

        Dim pAoInitialize As AoInitialize

        Dim licenseStatus As esriLicenseStatus
        Dim productCode As esriLicenseProductCode

        'Create an AOInitialize object
        pAoInitialize = New AoInitialize

        Select Case UCase(Ltype)
            Case "ARCINFO"
                productCode = esriLicenseProductCode.esriLicenseProductCodeArcInfo
            Case "ARCEDITOR"
                productCode = esriLicenseProductCode.esriLicenseProductCodeArcEditor
            Case "ARCVIEW"
                productCode = esriLicenseProductCode.esriLicenseProductCodeArcView
            Case Else
                productCode = esriLicenseProductCode.esriLicenseProductCodeArcView
        End Select

        licenseStatus = pAoInitialize.Initialize(productCode)

Question is, how do I then 'close' or 'unbind' from the license without closing the application? Our users access licenses from a pool and are charged on a usage rate, so being able to disconnect when not using the license would be great. We can do with extensions using checkin/checkout, however 'shutdown' is not working for me. The license is still allocated, only becoming available in the pool when the application is closed.

I'm using ArcGIS 10, VB .NET.

Thanks

Rob
0 Kudos
4 Replies
RichardWatson
Frequent Contributor
When you create an application in Visual Studio using one of the ArcGIS templates it generates licensing code for you.  I suspect that you can also look at the samples.  The code it generates allows you to acquire a license, deals with extensions, and provides a shutdown method which releases it all.
0 Kudos
RobEllis
New Contributor
Thanks Richard, 'shutdown' is not actually releasing the license... perhaps this is a bug that needs attention with a service pack?
0 Kudos
RichardWatson
Frequent Contributor
0 Kudos
RobEllis
New Contributor
It would appear that conceptually I can't achieve what I want with the current 'structure' of the binding process. ESRI has designed this process with the assumption that an 'application' will require an ArcGIS application/license while ever the application is active, whereas my 'application' only requires ArcGIS processing for some of the inbuilt functionality. Looks like I'll have to separate out this functionality into an ArcGIS-specific application/s, which is painful, but not impossible. Perhaps this will improve down the track, but I doubt it.

Thanks Richard for your comments

Rob
0 Kudos