About the ArcGIS License Initializer dialog box


SummaryThis dialog box, as part of the ArcGIS Visual Studio integrated development environment (IDE) Integration Framework, allows you to select the ArcGIS product and extension licenses to be initialized when your application starts up.

Additional Requirements
  • ArcGIS Visual Studio IDE Integration Framework for Visual Studio 2005.

In this topic


You can find step-by-step information on using the different elements of the ArcGIS Visual Studio Integration Framework in the .NET development walk-throughs.

Using the ArcGIS License Initializer dialog box

In ArcGIS 9.2, all stand-alone applications are required to explicitly initialize with a suitable ArcGIS product license before any ArcObjects component is accessed. You can use the ArcGIS License Initializer dialog box to generate and add license initialization code to the appropriate application startup point in your project.
 
If you have installed the ArcGIS Engine Developer Kit and are writing a Windows application, you can use the LicenseControl to initialize your application instead. In this case, you should remove any redundant license initialization code added to the project.
 
To view the ArcGIS License Initializer dialog box, choose Add ArcGIS License Checking from the Project menu. This dialog box is also shown as a page in the ArcGIS Project Wizard. See the following screen shot:
 
 
The options in the ArcGIS License Initializer dialog box are explained as follows:
Click the OK button to add (or update) license initialization code in your project; the LicenseInitializer helper class will be added to your project.
 
You can undo changes to the license initialization code by opening the code file containing the startup object and clicking the Undo button.
 
Update or remove license initialization
You can rerun this dialog box for the same project at any time to update the products and extensions with which to initialize the application. You can also use this dialog box to completely remove its license initialization code by unchecking all the products before clicking OK. You will be prompted to delete or exclude the LicenseInitializer helper class; click Yes to delete the file. It is recommended to remove license initialization code before you change the startup object project property.
 

Application startup and shutdown

The license initializer attempts to locate the most appropriate application startup method in the project, depending on the startup objects specified in the project property, the language, and project type. See the following:
 
In most cases, license initialization code will be inserted to the application Startup event or in the Main Sub in a VB.NET project. The only exception is when you have license checking code already added in the Form.OnLoad event. You will get a warning on the Error List window if license initialization code has to be inserted in the OnLoad event. It is because an ArcGIS Engine control on the form may need to access ArcObjects components during form initialization and form initialization happens before the OnLoad event is raised, for example, a MapControl with a map document property set.
 
To fix this, clean up license initialization code by first unchecking all products in the dialog box and clicking OK. Make sure code is removed from the OnLoad and Dispose methods. Running the ArcGIS License Initializer dialog box again will add the code in either the Startup event or Main Sub.
 
If you decide to change the startup object project property, it is recommended you clean up and remove all license initialization code before you make the change.
 
Add-in compatibility—This tool is capable of recognizing and upgrading code inserted by the License Initializer add-in available for Visual Studio .NET 2003.


See Also:

Overview: ArcGIS Visual Studio IDE Integration Framework
About the ArcGIS Project Wizard