English

Error: ArcGIS version not specified. You must first bind to an ArcGIS version prior to using any ArcGIS components

Error Message

When migrating an ArcGIS 9.3 Engine application to ArcGIS 10.x, the following COM exception may be returned at the first call of ArcObjects code, for example, IAoInitialize.Initialize method.

COMException message:
"ArcGIS version not specified. You must first bind to an ArcGIS version prior to using any ArcGIS components."

Cause

This exception is thrown because the standalone Engine application has not bound to an ArcGIS product before calling any ArcObjects code. Runtime binding is a new requirement since ArcGIS 10.0.

Solution or Workaround

The binding is achieved by including the following sample code before invoking any ArcObjects code.

  • For ArcGIS Engine, use the following code:
    [C#]

    Code:
    ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.Engine);


    [VB.NET]

    Code:
    ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.Engine)

  • For ArcGIS Desktop, use the following code:
    [C#]

    Code:
    ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.Desktop);


    [VB.NET]

    Code:
    ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.Desktop)