When run the arcgis engine codes in the console application, may come to the exception: HRESULT: 0x80040228.
Then can use these code to enable the lisence:
ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.EngineOrDesktop); ESRI.ArcGIS.esriSystem.IAoInitialize ao = new ESRI.ArcGIS.esriSystem.AoInitialize(); ao.Initialize(ESRI.ArcGIS.esriSystem.esriLicenseProductCode.esriLicenseProductCodeEngine);
http://forums.arcgis.com/threads/93145-COM-Exception-from-HRESULT-0x80040228