AnsweredAssumed Answered

ArcObjects 10.2 - Map Control works with 1 form but not the next - licensing

Question asked by rutkowskima on Jul 22, 2014

When initializing an application (going through the proper procedure of binding to the application then checking out a license), my main form which contains a mapcontrol, TOC control and a toolbar control loads up fine with no complications. My application contains a button which then loads up another form which also contains a map, and toc control. However, when the second form loads, I get a licensing error.

 

Exception Information: An error occurred creating the form. See Exception.InnerException for details.  The error is: You must have a license to use this ActiveX control.

Stack Trace:    at AART.My.MyProject.MyForms.Create__Instance__[T](T Instance)

   at AART.My.MyProject.MyForms.get_frmSuitabilityCreate()

   at AART.frmModifyAttributes.cmdNext1_Click(Object sender, EventArgs e)

Source: AART

Inner Exception: You must have a license to use this ActiveX control.

Inner Exception Stack Trace:    at System.Windows.Forms.AxHost.CreateInstance()

   at System.Windows.Forms.AxHost.GetOcxCreate()

   at System.Windows.Forms.AxHost.TransitionUpTo(Int32 state)

   at System.Windows.Forms.AxHost.CreateHandle()

   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)

   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)

   at System.Windows.Forms.AxHost.EndInit()

   at AART.frmSuitabilityCreate.InitializeComponent()

   at AART.frmSuitabilityCreate..ctor()

Inner Exception Source: System.Windows.Forms

 

This only occurs in production where the user has only an ArcGIS Desktop license (after publishing the application). In development where I'm running against an arcengine developers license the application works fine. The second form only contains a mapcontrol and toc... no other controls.

 

Is there a proper approach to initializing a second map control on a separate form?

On a windows 7 64bit machine running ArcGIS Desktop 10.2 in production. On development, a windows 7 64 bit machine running ArcEngine, Dev kit

Outcomes