VoyagerGIS

slow initialization

Discussion created by VoyagerGIS on Jan 29, 2010
noticed that initializing arcobjects is now slow when it use to be instantaneous in 9.2/9.3

Currently a call to m_AOLicenseInitializer.InitializeApplication

takes ~ 2.5 seconds.. is this the new normal?

sample attached

code follows:

static void Main()
    {
      DateTime startTime = DateTime.Now;
      ESRI.ArcGIS.VersionManager.LoadVersion(ESRI.ArcGIS.ProductCode.Desktop, "9.4");

      //ESRI License Initializer generated code.
      if (!m_AOLicenseInitializer.InitializeApplication(new esriLicenseProductCode[] { esriLicenseProductCode.esriLicenseProductCodeArcView, esriLicenseProductCode.esriLicenseProductCodeArcEditor, esriLicenseProductCode.esriLicenseProductCodeArcInfo },
      new esriLicenseExtensionCode[] { }))
      {
        System.Windows.Forms.MessageBox.Show(m_AOLicenseInitializer.LicenseMessage() +
        "\n\nThis application could not initialize with the correct ArcGIS license and will shutdown.",
        "ArcGIS License Failture");
        m_AOLicenseInitializer.ShutdownApplication();
        Application.Exit();
        return;
      }

      TimeSpan span = DateTime.Now.Subtract(startTime);
      System.Diagnostics.Debug.WriteLine(string.Format("Initialize ArcObjects: {0} seconds", span.TotalSeconds));

      Application.EnableVisualStyles();
      Application.SetCompatibleTextRenderingDefault(false);
      Application.Run(new Form1());
      //ESRI License Initializer generated code.
      //Do not make any call to ArcObjects after ShutDownApplication()
      m_AOLicenseInitializer.ShutdownApplication();
    }

Attachments

Outcomes