DEAR PEOPLE FROM THE FUTURE: Here's what we've figured out so far…

Does anyone know the lifecycle of an AxControl (AxTOCControl)?

I have a complex application, that uses several technologies (Spring.NET, NHibernate, DevExpress components) among them Esri's ArcObjects.

this application starts normally, it binds a product (engine or desktop) then it gets the licence (ArcEngine), and it starts, so it is getting the proper license.

Then, minutes after the aplication has started, it throws a dialog box saying that I do not have the license of ArcView (in fact I do not have it, but i do not need it, because my code only use functionalities related with ArcEngine, not even extensions).

If i click in the button of this dialog box, then the application is closed.

I have been trying to capture the thread that launches this dialog box, but this attempt has been useless. Also I have tried using the tool Process Monitor and Process Explorer, but it has not been able to get information.

I need to understand the life cycle of the AxTOCControl to indetify when it is losing the license. Or if someone knows why a control can loss the binding to the existing license it will be very hepful!


I think I encountered a similar issue at Problem Initializing License for ArcEngine application. In my case, the application was binding just fine, as yours was, but when I tried to use any AxControls (Map, TOC, Toolbar), I got the same error that you did.

I was unable to resolve the issue with technical support, but found a workaround for my project. If you are using AoInitialize put in place by your IDE (?) (in my case this is encased in LicenseInitializer that was auto-generated for me), you can try my workaround. Perhaps it will work for you? I don't know anything about Spring, NHibernate, etc., so my apologies if the syntax below doesn't match for you. I'm using VB.net.

Quick Steps:

  1. remove all the code in the ApplicationEvents file that referred to the LicenseInitializer (if you don't have this auto-generated code, remove everything the AoInitialize class is doing)
  2. Add an AxLicenseControl to your startup form; right click and choose properties to choose the license you need.
  3. Add ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.EngineOrDesktop) to your startup form's Public Sub New (vb.net) or static void Main (c#)

That's what worked for me.

I found this article helpful in setting up the AxLicenseControl: ESRI how-to

  • I'm going to try it.....i really dont know how to do it (well in my environment)...but i'm going to do it – XtianGIS Oct 16 '12 at 22:04
  • I try to remove the LicenseInitializer that was autogenerated, guess what? in an small application the Ax map controls, works fine without the license initializer....a little bug??? – XtianGIS Oct 17 '12 at 19:40
  • I'm in the process of remove the LicenseInitializer that was auto-generated, and insert the AxLicenseControl...but i got a blocker....How do i configure the AxLicenseControl througth code (type of license)?? i perform changes in the AxLicenseControl but the changes are not reflected in the form1.designer.cs file – XtianGIS Oct 17 '12 at 19:45
  • When I added the AxLicenseControl, I right-clicked in the form designer, chose properties, and then specified the type of license. This was not available in the normal properties window, just by right-clicking on the control in the designer. If you've done that, have you also added the RuntimeManager.Bind to static void Main? – BeckyZ Oct 20 '12 at 23:23
  • thanks, but i need to know how to perform the same process that you describe, but using code, because i perform several geograpich objects operations prior to the load of the main form – XtianGIS Oct 22 '12 at 15:39

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.