The current XML-based serialization (Simple, Explicit, Full) has several limitations:
- Manual type handling - each XRM type (EntityReference, OptionSetValue, Money, OptionSetValueCollection, etc.) requires hand-written serialization and deserialization cases in
EntityExtensions.cs and Common.cs. Every new type requires code changes in multiple places.
- Verbosity - XML is significantly larger than equivalent JSON, slowing I/O for large datasets.
Fragile round-trip - type fidelity depends on string tags like type="OptionSetValue" that must be maintained manually.
Proposal
Add a new SerializationStyle.Json option backed by Xrm.Json.Serialization, which natively handles all Microsoft.Xrm.Sdk types including EntityReference, OptionSetValue, OptionSetValueCollection, Money, AliasedValue, etc.
Benefits
- Zero manual type handling - new attribute types are supported automatically
- Compact output - typically 40-60% smaller than equivalent XML
- Git-friendly - JSON with sorted keys produces clean, readable diffs
- Standard tooling - JSON is universally supported for diffing, querying (jq), and editing
The current XML-based serialization (Simple, Explicit, Full) has several limitations:
EntityExtensions.csandCommon.cs. Every new type requires code changes in multiple places.Fragile round-trip - type fidelity depends on string tags like type="OptionSetValue" that must be maintained manually.
Proposal
Add a new
SerializationStyle.Jsonoption backed by Xrm.Json.Serialization, which natively handles all Microsoft.Xrm.Sdk types including EntityReference, OptionSetValue, OptionSetValueCollection, Money, AliasedValue, etc.Benefits