About the ArcGIS .NET code converter


SummaryThe ArcGIS Code Converter Wizard converts Visual Studio projects and solutions built against ArcGIS 8.3–9.1 to work with ArcGIS 9.2. You can either convert the projects in the current solution or use the batch option to convert multiple solutions or projects at a time.

Additional Requirements
  • ArcGIS Visual Studio integrated development environment (IDE) Integration Framework for Visual Studio 2005.

In this topic


Using the ArcGIS .NET code converter

The steps for each project or solution are as follows:
  1. The code that uses ArcGIS 8.3 namespaces is changed to use ArcGIS 9 namespaces. For example:
    "Dim pPoly As ESRI.ArcObjects.Core.IPolygon" will be converted to
    "Dim pPoly As ESRI.ArcGIS.Geometry.IPolygon"
  2. The Imports (Visual Basic .NET) or Using (C#) namespace statements are removed and appropriate new Imports and Using namespace statements for ArcGIS 9 namespaces are added. For example:
"Imports ESRI.ArcObjects.Core" will be removed and replaced by the namespaces required by the code, perhaps the following:
"Imports ESRI.ArcGIS.esriSystem"
"Imports ESRI.ArcGIS.Geometry"
  1. ArcGIS 8.3 assembly references are removed from the project and the appropriate ArcGIS 9 assembly references are added.
  2. In ArcGIS 9.2, the ESRI.ArcGIS.Utility has become obsolete in favor of the ESRI.ArcGIS.ADF assembly. The code converter will replace references to and types in the ESRI.ArcGIS.Utility with references to and types in the ESRI.ArcGIS.ADF assembly.
  3. If you have chosen to convert any Visual Studio .NET 2003 projects or solutions, the wizard will need to upgrade them to Visual Studio 2005 format before performing the ArcGIS code conversion—you will be informed of this step to give you the opportunity to cancel the conversion.

[VB.NET]
AxToolbarControl.AddItem("esriControlCommands.ControlsOpenDocCommand", , -1, , , esriCommandStyles.esriCommandStyleIconOnly)

[VB.NET]
AxToolbarControl.AddItem("esriControls.ControlsOpenDocCommand", , -1, , , esriCommandStyles.esriCommandStyleIconOnly)

Starting the ArcGIS code conversion

Do the following to start the ArcGIS code conversion in Visual Studio 2005:
  1. Click File, Open, and Convert. When the Convert dialog box appears, click ArcGIS Code Converter from the list of available converters.
  2. Click Add to current solution or Create new solution.
  3. Click OK to launch the ArcGIS Code Converter Wizard. 
 
See the following screen shot of the Convert dialog box:
 
 
If your copy of Visual Studio has Visual Basic development settings, this command is not available by default. If this is the case, open the Customize dialog box by clicking Tools, then Customize, and click the Commands tab. Select File in the categories list and add the Convert command onto any toolbar.
Choosing type and logging options
When you complete the steps in the Convert dialog box, the ArcGIS Code Converter Wizard appears. See the following screen shot:
 
 
 The following describes the options in this section of the wizard:
 
Choosing solutions or projects to convert
The next section of the wizard converts the selected projects or solutions. See the following screen shot:
 

 
The following describes the options in this section of the wizard:
 
Upgrading files before conversion
If you selected files with an Upgrade Required status, the Files Need to be Upgraded section of the wizard appears. You can choose not to upgrade the files and skip them in the conversion. Otherwise, click the Upgrade Now button to start the upgrade process. Before the file is upgraded, a backup is automatically created in a backup folder placed alongside of the project or solution. The upgrade process may take a while to complete. Only files that are successfully upgraded to Visual Studio 2005 format can continue in the conversion process. See the following screen shot:
 
 
Backup option
The code converter saves all of its work. However, you will not be able to undo the changes without backing up the solution. Click Yes on the backup option section of the wizard to let the code converter create a backup file before the conversion. A folder with the default name of ArcGISBackup will be placed alongside the solution or project.
It is recommended that you back up your files instead of relying on the automatic backup.
Create a new solution
If you selected Create new solution in the Convert dialog box, you can specify the location to create a new solution that links to all converted projects. The log file will be added as a solution item in the specified location.

 
Code conversion summary
Review the summary and click Finish to start the code conversion. If logging is enabled, a log file displays in Visual Studio when the conversion is done. Depending on the number and size of files to convert, it may take a while to complete the conversion.


See Also:

Overview: ArcGIS Visual Studio IDE Integration Framework