The steps for each project or solution are as follows:
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"
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:
ArcGIS 8.3 assembly references are removed from the project and the appropriate ArcGIS 9 assembly references are added.
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.
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.
If your code uses multiple Imports or Using statements (for example, Imports ESRI.ArcObjects and Imports ESRI.ArcObjects.Core), it is recommended that you remove one of the Imports or Using statements (for example, Imports ESRI.ArcObjects) and fix any type casts before running the code converter.
If your C# code uses the tagRECT structure, manually change the case of the Left, Right, and Top properties to left, right, and top after the conversion process.
The code converter is not capable of converting ProgIDs. See the following code example:
Do the following to start the ArcGIS code conversion in Visual Studio 2005:
Click File, Open, and Convert. When the Convert dialog box appears, click ArcGIS Code Converter from the list of available converters.
Click Add to current solution or Create new solution.
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:
How do you want to convert your ArcGIS solutions or projects?—You can convert projects currently loaded in Visual Studio or convert many projects at the same time with the batch option. The Convert current solution projects option is available if you previously selected Add to current solution in the Convert dialog box.
Do you want to enable logging for the conversion?—When logging is enabled, the ArcGIS code converter generates a log file to be viewed at the end of the conversion. A single log file is created no matter how many projects or solutions are converted. The log file will be added to Visual Studio as a solution item with the default name of ArcGISConverter.log.
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:
Browse option—If you selected the batch conversion option, select the type of files you want to convert and click the Browse button. The default browse option (browse for folder) is to select a folder and have all the .NET projects or solutions in that folder and its subfolders listed. If you want to browse and select files individually, click the drop-down arrow on the Browse button and select the Browse for Files drop-down option. Click the Clear All button to clear the list.
If you have chosen to convert the current solution projects, the browsing option will not be available. Instead, the wizard automatically lists any C# or VB.NET projects currently loaded in Visual Studio.
Add files for conversion—Click the Add or Add All button to add files to the conversion list at the bottom of the wizard. If a project or solution was created in an older version of Visual Studio (for example, Visual Studio .NET 2003), Upgrade Required displays in the Status column, which means you must upgrade to Visual Studio 2005 format before the conversion. Files in Visual Studio 2005 format show with a Ready status. You can click the Remove or Remove All button to change the list of selected files for conversion.
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.