I want to check all installed products, and bind to the first available one. Now I have a machine with an expired Engine license, but with a valid Desktop license. The following code should do the trick, but it doesn't. If the first checked license is not available, all others fail as well. If I change the order of the list, e.g. Desktop comes first, it works, if Engine is first, it doesn't.
foreach (var product in new[] {ProductInfo.Engine, ProductCode.Desktop, ProductCode.Server})
{
try
{
RuntimeManager.BindLicense(product, LicenseLevel.Standard);
Console.WriteLine("Arcgis product {0} is licensed", product);
return true;
}
catch (RuntimeManagerException e)
{
Console.WriteLine("Arcgis product {0} is not licensed", product);
Console.WriteLine(e.Message);
}
}
return false;
Any idea why this doesn't work?