// Before executing the offending line, I do this to "bind to an ArcGIS version". // (In this example I use Engine, but I have the same problem if I use Server). RuntimeManager.Bind(ProductCode.Engine); // (These are the variables I'm working with...) esriLicenseStatus licenseStatus; private IAoInitialize m_AoInitialize = new AoInitializeClass(); esriLicenseProductCode productCode; // This line is where I get the exception... licenseStatus = m_AoInitialize.IsProductCodeAvailable(productCode);
Not too long after I posted this message, I found an explanation for the behavior I described. I was, indeed, initializing an ArcObjects class as a private member of my class before calling RuntimeManager.Bind(). That initialization didn't throw an exception; but by creating it after calling RuntimeManager.Bind(), I no longer seem to see the problem mentioned in my post.