diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e59c2b54..7a7c61ac0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,7 +48,7 @@ different versioning scheme, following the Haskell community's ### C# ### -* There were no C# changes in this release. +* Fixed compatibility with .NET 9. ## 13.0 ## 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(