ERROR
When trying to compile ArcObjects code to set an interface property that has an input parameter (typically the parameter is an index), Visual Studio 2015 returns the following compiler error:
Error: BC30643 Property ‘ESRI.ArcGIS.xxx’ is of an unsupported type
Error: BC30643 Property is of an unsupported type (Visual Basic)
Here is an example using IFieldsEdit.
Dim pFieldEdit As IFieldEdit = pField pFieldEdit.Name_2 = "OBJECTID" pFieldEdit.AliasName_2 = "FID" pFieldEdit.Type_2 = esriFieldType.esriFieldTypeOID Dim pFieldsEdit As IFieldsEdit = pFields pFieldsEdit.FieldCount_2 = 2 pFieldsEdit.Field_2(0) = pField
When trying to compile ArcObjects code to set an interface property that has an input parameter (typically the parameter is an index), Visual Studio 2015 returns the following compiler error:
Error: CS1546 Property, indexer, or event is not supported by the language, try directly calling accessor method...Here is an example using IFieldsEdit.
IField field = new Field(); IFieldEdit fieldEdit = field as IFieldEdit; fieldEdit.Name_2 = "OBJECTID"; fieldEdit.AliasName_2 = "FID"; fieldEdit.Type_2 = esriFieldType.esriFieldTypeOID; IFields fields = new Fields(); IFieldsEdit fieldsEdit = fields as IFieldsEdit; fieldsEdit.Field_2[0] = field;
Several WriteOnly properties with input parameters are affected and inaccessible with Visual Basic in Visual Studio 2015 and include, but may not be limited to:
Workaround for Visual Basic
For the issue with Visual Basic, use Visual Studio 2013 to compile and debug the code.
Workaround for C#
When using C#, following the compiler output, rewrite the code as shown below:
IFields fields = new Fields(); IFieldsEdit fieldsEdit = fields as IFieldsEdit; //fieldsEdit.Field_2[0] = field; fieldsEdit.set_Field(0, field);
This fixes the compiler error.
Get help from ArcGIS experts
Download the Esri Support App