Select to view content in your preferred language

How do I convert an extension containing a MapControl to ArcGIS 10?

2715
12
10-07-2010 02:11 PM
WilliamKirchhoff
Emerging Contributor
I created an extension to ArcMap (9.3.1) that employs a MapControl.  I recently upgraded to ArcGIS Desktop 10 and found to my dismay that the MapControl - which resides in ESRI.ArcGIS.Controls library - now requires an Engine license.  Setting aside my deep displeasure at this change in marketing strategy, my operative question is - how much do I have to spend to enable the MapControl so that I can upgrade my extension to run in ArcMap?
I have had several conversations with ESRI's sales & marketing people and I'm still confused.  It appears that if I purchase an EDN subscription I will receive the ArcGIS Engine SDK and I should be able to convert my 9.3.1 extension to 10.0.   My problem is that the ESRI folks keep talking about "production level" licenses - assuming, I guess, that they think I am trying to create a stand alone app that will be available over the web.  But, my program is an extension to ArcMap and will only be used within that environment - therefore the user has a ArcGIS Desktop license and should not need any additional licensing run to run my extension with its embedded MapControl?
I would appreciate hearing from anyone who has had to convert a MapControl bearing tool, command or extension from 9.3.x to 10 and what it took license wise to make it work.
Thanks.
0 Kudos
12 Replies
AndrewLovett
New Contributor
We are having the same issue.  Does anyone have a resolution or any further info regarding this.
0 Kudos
MelitaKennedy
Esri Notable Contributor
I created an extension to ArcMap (9.3.1) that employs a MapControl.  I recently upgraded to ArcGIS Desktop 10 and found to my dismay that the MapControl - which resides in ESRI.ArcGIS.Controls library - now requires an Engine license.  Setting aside my deep displeasure at this change in marketing strategy, my operative question is - how much do I have to spend to enable the MapControl so that I can upgrade my extension to run in ArcMap?
I have had several conversations with ESRI's sales & marketing people and I'm still confused.  It appears that if I purchase an EDN subscription I will receive the ArcGIS Engine SDK and I should be able to convert my 9.3.1 extension to 10.0.   My problem is that the ESRI folks keep talking about "production level" licenses - assuming, I guess, that they think I am trying to create a stand alone app that will be available over the web.  But, my program is an extension to ArcMap and will only be used within that environment - therefore the user has a ArcGIS Desktop license and should not need any additional licensing run to run my extension with its embedded MapControl?
I would appreciate hearing from anyone who has had to convert a MapControl bearing tool, command or extension from 9.3.x to 10 and what it took license wise to make it work.
Thanks.


I work at Esri in development; I freely admit that I do not understand all the licensing details. I did find this statement on the "How to create a MapControl application" page (http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#//000100000008000000😞

Running the application with an ArcGIS Desktop license

Since the application is set by default, it requires an ArcGIS Engine Runtime license. However, if you want it to run on a machine with ArcGIS Desktop (ArcView, ArcEditor, or ArcInfo), or to check for and consume a floating ArcGIS Desktop license, update the LicenseControl to verify the other licenses as well.

Do the following steps to run the application with a license:

Right-click the LicenseControl and choose Properties. The Properties dialog box appears.

Select the check boxes of the licenses you want to use when the application runs.

The application always uses the lowest level of licensing that is available. For example, if a machine has an ArcGIS Engine and ArcEditor license, the application uses the ArcGIS Engine license. If there are ArcView and ArcInfo floating licenses available and both of those options were selected in the LicenseControl, the application uses the ArcView license.

-----
When it says 'set by default,' it means that the VisualStudio Esri wizard automatically sets up licensing for Engine.

Melita
0 Kudos
JonHall
Frequent Contributor
I had the same issue, and share your pain.

After upgrading to ArcGIS Desktop 10.0 SDK,  you can no longer edit a form (in the Designer) containing a MapControl that was created in Visual Studio using the ArcGIS Desktop 9.3.x SDK

To edit the form (in the Designer), ArcGIS 10.0 now requires that you have an ArcEngine SDK license through EDN.

Turns out that your extension will probably work fine in ArcMap 10.0 (after updating references), and you can build your extension in Visual Studio without an ArcEngine SDK license, as long as you do not need to make any Designer edits to the form with the MapControl on it (and none were required, in my case).

The key for me was adding a new ApplicationEvents.vb project to my user interface project, and pasting the following code into the empty project. The license RuntimeManager.Bind had to happen long before loading the form with the MapControl

You can debug, as well as load it at runtime, with only an ArcGS 10 Desktop license, if you use ProductCode.EngineOrDesktop

Namespace My

 ' The following events are availble for MyApplication:
 ' 
 ' Startup: Raised when the application starts, before the startup form is created.
 ' Shutdown: Raised after all application forms are closed.  This event is not raised if the application terminates abnormally.
 ' UnhandledException: Raised if the application encounters an unhandled exception.
 ' StartupNextInstance: Raised when launching a single-instance application and the application is already active. 
 ' NetworkAvailabilityChanged: Raised when the network connection is connected or disconnected.
 Partial Friend Class MyApplication

  Private Sub MyApplication_Shutdown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shutdown
   Try
    'Debug.WriteLine(Shutdown.")
   Catch ex As Exception
   End Try
  End Sub

  Private Sub MyApplication_Startup(ByVal sender As Object, ByVal e As Microsoft.VisualBasic.ApplicationServices.StartupEventArgs) Handles Me.Startup
   Try
    'Debug.WriteLine("Startup...")
    'Debug.WriteLine("Before load of frmMain")

    'added ESRI's runtime binding for ArcGIS 10.0
    ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.EngineOrDesktop) 

   Catch ex As Exception
   End Try
  End Sub
 End Class

End Namespace


Oh yeah, and the LicenseControl was on the same form asthe MapControl, that I could not edit in the Designer. Luckily, it only required edits to the forms' code, not it's design layout. 
PS. That was good advice from Melita, as well.
0 Kudos
AlexanderGray
Honored Contributor
Doesn't it bug you that you need to buy another license (Engine SDK) to develop an ArcGIS desktop application even if you have a bunch of ArcInfos?
0 Kudos
AlexanderGray
Honored Contributor
It turns out if I try to run the code that uses the mapcontrol on my machine even if it is compiled in release mode and I am running with an ArcInfo license, it still demands an ArcGIS Engine SDK license.  Do I need to uninstall the dev kit and Visual studio from my machine every time I want to run ArcMap?
0 Kudos
JohnFisher
Emerging Contributor
I noticed the same situation on my developer machine today. I installed the ArcEngine runtime, and provided a single-user authorization code for the engine developer kit. I also noticed the name of the desktop license server under the Engine section, but I thought it dealt only with concurrent licenses and not single-use.

I spent most of a day trying to get a pagelayout control to work on a Windows form in my custom extension. The only way I was finally able to view the pagelayout in design mode was by adding a license control to my form, and adding the RuntimeManager.Bind(Engine) in the New() contructor (before InitilizeLayout is called). It seemed to display fine in design mode using .Bind(Desktop) or Bind(Engine). However, when I debugged the app, I got a mysterious error "(missing) license not available. Check for Single-use license in ArcGis Administrator". The error message did not mention which license was unavailable. By right clicking the license control in the IDE, I was able to select other license levels. I typically run ArcInfo license, but when I chose that level exclusively on the license control, the form crashes in Visual Studio 2010. So far, I can only get my extension to run properly by using an Editor license in the License control properties, and by switching the ArcGIS Admin to use an editor license from our pool.

This whole process with binding and licensing a pagelayout control in an ArcMap extension in very tedious and seems altogether unnecessary, since I am required to have a license anyway to run ArcMap. I hope someone can explain to me a better way of doing this. The other recent thread from Melita at ESRI gave me some ideas, but did not solve my problem. I'll try clearing the license server name from the engine tab of the ArcGIS Administrator and see if that works. I wonder what other surprises will occur when I go to deploy!
0 Kudos
AlexanderGray
Honored Contributor
I have been struggling with this for a few months.  I used the machine of one of our licensed developers for testing purposes.  It turns out if your mapcontrol is set with preview in design mode, when you deploy it in arcmap on a non-developer machine, it requests an engine developer license on the deployment machine.  If you turn off preview in design mode, you can compile and deploy it ok!
0 Kudos
AllanMills
Regular Contributor
I have been struggling with this for a few months.  I used the machine of one of our licensed developers for testing purposes.  It turns out if your mapcontrol is set with preview in design mode, when you deploy it in arcmap on a non-developer machine, it requests an engine developer license on the deployment machine.  If you turn off preview in design mode, you can compile and deploy it ok!


Can I ask exactly how to do this please? I don't see any such property associated with the map control.
0 Kudos
AlexanderGray
Honored Contributor
I forget exactly how to do it and my license expired and I haven't bothered installing the new one since I really don't do engine development (we have it but don't use it.)  To the best of my memory, If you right click on the mapcontrol in the form, you can get to properties and there is a setting to turn the preview the map control in the development environment.  As I recall it is a check box in the properties form that allows you to select the start up mxd.
0 Kudos