diff --git a/cs/src/core/expressions/DeserializerTransform.cs b/cs/src/core/expressions/DeserializerTransform.cs index b89e1dfbb..8d7feab03 100644 --- a/cs/src/core/expressions/DeserializerTransform.cs +++ b/cs/src/core/expressions/DeserializerTransform.cs @@ -523,7 +523,7 @@ Expression Container(IParser parser, Expression container, Type schemaType, bool else { var capacity = container.Type.GetDeclaredProperty("Capacity", count.Type); - if (capacity != null) + if (capacity != null && capacity.CanWrite) { var cappedCount = Expression.Variable(typeof(int), container + "_count"); beforeLoop = ApplyCountCap(