Hello,
Ultimately I am trying to add Field to a FeatureClass using the below method within an ESRI Add-In for ArcMap written in C#
public void AddFieldToFeatureClass(IFeatureClass featureClass, IField field)
{
ISchemaLock schemaLock = (ISchemaLock)featureClass;
try {
schemaLock.ChangeSchemaLock(esriSchemaLock.esriExclusiveSchemaLock);
featureClass.AddField(field);
}
catch (Exception exc) {
Console.WriteLine(exc.Message);
}
finally {
schemaLock.ChangeSchemaLock(esriSchemaLock.esriSharedSchemaLock);
}
}
Now when I try this, I receive the following error:
"exc.Message = "The application is not licensed to create or modify schema for this type of data ""
After doing searching for this error I see that the problem is my license and I need to bind it to one that will allow me to use this method.
So I chose the following:
ESRI.ArcGIS.RuntimeManager.BindLicense(ESRI.ArcGIS.ProductCode.EngineOrDesktop, ESRI.ArcGIS.LicenseLevel.GeodatabaseUpdate);
Which then results in the new following error:
"Additional information: Unable to initialize an ArcGIS 10.5 license. This process is already initialized to Basic which is not one of the requested licenses: Engine Geodatabase Update, Standard, Advanced"
It is here that I do not necessarily know what to do. I have looked for "unbind" methods to allow me to reinitialize the license type somehow. I have not found any, as they probably do not exist.
How do I go about doing this?
Is there something in ArcMap I should change within ArcGIS Administrator?
Thank you for your time.