Licensing basics...

883
2
12-31-2013 07:14 AM
BillZborowski
New Contributor
Hi everyone,

I have a beginner question with respect to licensing apps developed using the ArcObjects SDK.  Here's my environment:

Desktop ->10.1 SP1 Desktop Basic, 10.1 SP1 SDK installed, VS.NET 2k10

I have built a very small app, for proof of concept purposes, which pulls from the ArcGIS Desktop Basic license (I think).  Will this be okay to give to someone else who has a Desktop Basic license but not the Engine?

    ''' <summary>
    ''' This sub bings the ArcGIS runtime object to the application at runtime.
    ''' </summary>
    ''' <param name="sender">the sender object</param>
    ''' <param name="e">the event argument</param>
    ''' <remarks></remarks>
  Private Sub BindingArcGISRuntime(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.ResolveBindingEvent
    '
    ' TODO: Modify ArcGIS runtime binding code as needed
    '
    If Not RuntimeManager.Bind(ProductCode.Desktop) Then
      ' Failed to bind, announce and force exit
      MsgBox("ArcGIS runtime binding failed. Application will shut down.")
      End
    End If
  End Sub

Private Sub MyApplication_Startup(ByVal sender As Object, ByVal e As Microsoft.VisualBasic.ApplicationServices.StartupEventArgs) Handles Me.Startup
            Debug.Write("Initializing ESRI license...")
            'ESRI License Initializer generated code.
            m_AOLicenseInitializer.InitializeApplication(New esriLicenseProductCode() {esriLicenseProductCode.esriLicenseProductCodeStandard}, _
            New esriLicenseExtensionCode() {})
            Debug.WriteLine("Done.")
            Debug.Write("Initializing ArcObjects license...")
            GISValidationTool.initializeArcObjects()
            Debug.WriteLine("Done.")
        End Sub
0 Kudos
2 Replies
RichardWatson
Frequent Contributor
If you are building an executable image (EXE) which calls ArcObjects then you need to bind and, most probably, license.  I say "most probably" because usage of some minor APIs do not require a license.  How do you know?  Well... just try.

Sol is correct in that if you are writing a component (DLL) for ArcMap then you don't need to worry about any of this and should probably look at the add-in model.

The code you wrote requires a standard desktop license.  It will not succeed on a machine which has just an engine license.

If you can do so then I suggest to create one or more virtual machines and test your software on those.  This assumes that you are able to acquire all the licenses you need for testing.
ModyBuchbinder
Esri Regular Contributor
Hi

If you like a stand alone application (exe file) to run on a machine with desktop or engine runtime only your bind should look like this:
            if (!RuntimeManager.Bind(ProductCode.Engine))
            {
                if (!RuntimeManager.Bind(ProductCode.Desktop))
                {
                    MessageBox.Show("Unable to bind to ArcGIS runtime. Application will be shut down.");
                    return;
                }
            }


If you want your code to use different licenses you should write something like this (then it will look for different licenses):

if (!aoLicenseInitializer.InitializeApplication(new esriLicenseProductCode[] { esriLicenseProductCode.esriLicenseProductCodeEngine, esriLicenseProductCode.esriLicenseProductCodeBasic, esriLicenseProductCode.esriLicenseProductCodeStandard },
   new esriLicenseExtensionCode[] { }))



happy New Year
0 Kudos