From a427eb060984656a4947f6d2bd0f57a3598f9204 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 14 Feb 2026 20:00:56 +0000 Subject: [PATCH 1/2] Fix misleading docs claiming List is serializable by MobileFormatter Remove List from the list of supported SerializationInfo types in the CSLA 9 upgrade guide, and correct the serialization.md claim that List and Dictionary are supported. These standard .NET collection types are not directly serializable - users should use MobileList or MobileDictionary from Csla.Core instead. Fixes #4680 https://claude.ai/code/session_011R3Y2CSgCZrDwdVacjARaW --- docs/Upgrading to CSLA 9.md | 3 ++- docs/serialization.md | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/Upgrading to CSLA 9.md b/docs/Upgrading to CSLA 9.md index 50489698c5..5c96a64134 100644 --- a/docs/Upgrading to CSLA 9.md +++ b/docs/Upgrading to CSLA 9.md @@ -164,7 +164,8 @@ This includes: * `Guid` * `byte[]` * `char[]` -* `List` + +> ⚠️ Standard .NET collection types such as `List` and `Dictionary` are _not_ directly serializable by `MobileFormatter`. If you need a serializable list or dictionary as a property, use `MobileList` or `MobileDictionary` from `Csla.Core`, or register a custom serializer for your type. If you look at the implementation of [PocoSerializer](https://github.com/MarimerLLC/csla/blob/main/Source/Csla/Serialization/Mobile/CustomSerializers/PocoSerializer.cs) you'll see that it relies on `System.Text.Json` to serialize and deserialize the object, and stores the JSON string in the `SerializationInfo` instance. diff --git a/docs/serialization.md b/docs/serialization.md index 10213977c0..fa70c8dbf8 100644 --- a/docs/serialization.md +++ b/docs/serialization.md @@ -10,7 +10,9 @@ The default serializer for CSLA (version 6 and later) is `MobileFormatter`. This ### Using MobileFormatter -MobileFormatter supports many basic .NET types, including "primitive" types like `int`, `string`, `DateTime`, etc. It also supports `List`, `Dictionary`, and other common collection types. It also supports any type that implements `IMobileObject`, which includes all CSLA base types. +MobileFormatter supports many basic .NET types, including "primitive" types like `int`, `string`, `DateTime`, etc. It also supports any type that implements `IMobileObject`, which includes all CSLA base types. + +> ⚠️ Standard .NET collection types such as `List` and `Dictionary` are _not_ directly serializable by `MobileFormatter`. Use `MobileList` or `MobileDictionary` from `Csla.Core` for serializable collections, or register a custom serializer for your collection type. If you create your complex types by subclassing CSLA base types and using the managed property syntax, you don't need to do anything special to support serialization. From 134b0f7ff6301ea5c6518732fab2615a0874fc1d Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 14 Feb 2026 21:18:11 +0000 Subject: [PATCH 2/2] Restore List to SerializationInfo supported types list CslaBinaryWriter/Reader explicitly handle List (CslaKnownTypes.ListOfInt), so it IS a valid type for use in custom serializers via SerializationInfo.AddValue. Updated the warning to clarify that other generic collection types (List, Dictionary, etc.) are not supported. https://claude.ai/code/session_011R3Y2CSgCZrDwdVacjARaW --- docs/Upgrading to CSLA 9.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/Upgrading to CSLA 9.md b/docs/Upgrading to CSLA 9.md index 5c96a64134..0869fcc850 100644 --- a/docs/Upgrading to CSLA 9.md +++ b/docs/Upgrading to CSLA 9.md @@ -164,8 +164,9 @@ This includes: * `Guid` * `byte[]` * `char[]` +* `List` -> ⚠️ Standard .NET collection types such as `List` and `Dictionary` are _not_ directly serializable by `MobileFormatter`. If you need a serializable list or dictionary as a property, use `MobileList` or `MobileDictionary` from `Csla.Core`, or register a custom serializer for your type. +> ⚠️ Other generic collection types such as `List`, `Dictionary`, etc. are _not_ directly serializable by `SerializationInfo`. For serializable collections in business object properties, use `MobileList` or `MobileDictionary` from `Csla.Core`, or register a custom serializer for your type. If you look at the implementation of [PocoSerializer](https://github.com/MarimerLLC/csla/blob/main/Source/Csla/Serialization/Mobile/CustomSerializers/PocoSerializer.cs) you'll see that it relies on `System.Text.Json` to serialize and deserialize the object, and stores the JSON string in the `SerializationInfo` instance.