Invalid ArcGIS runtime binding. Application will shut down.

Discussion created by MDonnellyesriaustralia-com-au-esridist Employee on May 15, 2013
Latest reply on May 21, 2013 by Barbara_Schneider

I have created a ArcGIS console stand alone application using the new project wizard in Visual Studio 2010.

The default code created in the stub was around grabbing a desktop license:

class Program
        private static LicenseInitializer m_AOLicenseInitializer = new SetCustomMapExtent.LicenseInitializer();
        static void Main(string[] args)
            //ESRI License Initializer generated code.
            //m_AOLicenseInitializer.InitializeApplication(new esriLicenseProductCode[] { esriLicenseProductCode.esriLicenseProductCodeBasic, esriLicenseProductCode.esriLicenseProductCodeStandard, esriLicenseProductCode.esriLicenseProductCodeAdvanced },
            //new esriLicenseExtensionCode[] { });

            m_AOLicenseInitializer.InitializeApplication(new esriLicenseProductCode[] { esriLicenseProductCode.esriLicenseProductCodeAdvanced },
            new esriLicenseExtensionCode[] { });
            //Do not make any call to ArcObjects after ShutDownApplication()

The problem is that when I compile this stub and run it, I get the error in the subject of this post.

I am running this application on a machine with ArcGIS Desktop 10.1 SP1 with an Advanced license (borrowed) installed on it.

Any help would be appreciated.