Select to view content in your preferred language

.NET ArcEngine application using Desktop license - not working

4852
13
04-08-2011 04:29 PM
AdityaTadakaluru
Deactivated User
did you resolve this issue ? Im facing the similar issue when I install my ArcGIS engine 10 .NET app on a machine with ArcGIS Desktop10 and No ArcGIS Engine runtime.

Im doing

ESRI.RuntimeManager.BindLicense(ProductCode.EngineOrDesktop)

and when I check the RuntimeManager.ActiveRuntime its showing "Desktop" , but when the execution reaches endinit function of AXMapControl in my form.designer.cs , Im getting  You must have a license to use this ActiveX Control. Prior to AxMapControl.EndInit() I have AxToc and AxToolbar controls which are  initializing (BeginInit and EndInit) without any problem. Why is that ? From what I see AxMapControl is a .NET activex control.

I also tried SRI.ArcGIS.esriSystem.IAoInitialize aoInitialize = new ESRI.ArcGIS.esriSystem.AoInitializeClass(); option, and once I run aoInitialize.Initialize(arcview-license product code), I can see the esrilicensestatus as checked out. Even after that its still breaking at AxMapControl.EndInit().

Any ideas ?
0 Kudos
13 Replies
AlexanderGray
Honored Contributor
I know this is a long shot but I have had problems with the license in deployment if the mapcontrol was set to show preview in development environment.  Turning that off in the map control properties helped.
0 Kudos
AdityaTadakaluru
Deactivated User
I have it turned off already..
0 Kudos
AdityaTadakaluru
Deactivated User
I created the map control and other arcgis controls programatically in my form.cs instead of dragging and dropping them on to designer file (form.Designer.cs) and now its working.. Not sure why but its working...
0 Kudos
RudyLambert
Emerging Contributor
I found out the answer is indeed to create the control or controls programmatically. In VB.Net I first declared a new instance of the control:

Friend WithEvents Map1 As New ESRI.ArcGIS.Controls.AxMapControl

Then, following the InitializeComponent call, added the control:

Me.Controls.Add(Map1)

Finally, during the form load, call a routine that defines placement, anchor, etc.

Thanks to Aditya Tadakaluru for pointing me in that direction.
0 Kudos