ERROR

ArcObjects WriteOnly Properties are not accessible and throw “BC30643 Property is of an unsupported type” compile error in Microsoft Visual Studio 2015 with VB.NET

Last Published: April 25, 2020

Error Message

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

Visual Basic

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

C#

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;

Cause

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:

  • IFieldsEdit
  • IGeometryDefEdit
  • ITableSort
  • ISpatialJoin
  • ISymbolCollectionElement

Solution or Workaround

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.

Article ID: 000001060

Software:
  • ArcObjects SDK Microsoft NET Framework

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options