BC31102: 'Set' accessor of property '<propertyname>' is not accessible
A statement attempts to store the value of a property when it does not have access to the property's Set
procedure.
If the Set Statement is marked with a more restrictive access level than its Property Statement, an attempt to set the property value could fail in the following cases:
The
Set
statement is marked Private and the calling code is outside the class or structure in which the property is defined.The
Set
statement is marked Protected and the calling code is not in the class or structure in which the property is defined, nor in a derived class.The
Set
statement is marked Friend and the calling code is not in the same assembly in which the property is defined.
Error ID: BC31102
To correct this error
If you have control of the source code defining the property, consider declaring the
Set
procedure with the same access level as the property itself.If you do not have control of the source code defining the property, or you must restrict the
Set
procedure access level more than the property itself, try to move the statement that sets the property value to a region of code that has better access to the property.
See also
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for