From 30bccef1966e7faadc9483ce89f225540f847ee2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 17 Jun 2026 05:03:23 +0000 Subject: [PATCH 1/2] Add MessagePack 5.10.0-preview.1 entry to Changelog.md Co-authored-by: Daniel-Svensson <3167509+Daniel-Svensson@users.noreply.github.com> --- Changelog.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/Changelog.md b/Changelog.md index 2dfa73684..e0d5ee8e1 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,55 @@ +# 5.10.0 / AspNetCore 1.6.0 — MessagePack transport preview + +## AspNetCore 1.6.0 + +* Added MessagePack wire-format support (`application/vnd.msgpack`) via [#591](https://github.com/OpenRIAServices/OpenRiaServices/pull/591) + +### Enable MessagePack on the server + +```csharp +var builder = WebApplication.CreateBuilder(args); +builder.Services.AddOpenRiaServices() + .AddMessagePackSerialization(); +``` + +Optionally pass a custom `Nerdbank.MessagePack.MessagePackSerializer` to add converters or a custom comparer provider: + +```csharp +builder.Services.AddOpenRiaServices() + .AddMessagePackSerialization(opt => + { + opt.Serializer = new Nerdbank.MessagePack.MessagePackSerializer() + { + // custom converters / comparer provider + }; + }); +``` + +## Client (`OpenRiaServices.Client.DomainClients.Http`) + +* Added `MessagePackHttpDomainClientFactory` — a `DomainClientFactory` that communicates with the server using MessagePack over HTTP + +### Enable MessagePack on the client + +```csharp +DomainContext.DomainClientFactory = + new MessagePackHttpDomainClientFactory(baseUri, httpClientFactory); +``` + +Optionally pass a custom serializer: + +```csharp +var serializer = new MessagePackSerializer() +{ + // custom converters / comparer provider +}; + +DomainContext.DomainClientFactory = + new MessagePackHttpDomainClientFactory(baseUri, httpClientFactory, serializer); +``` + +For performance benchmark data see [PR #591](https://github.com/OpenRIAServices/OpenRiaServices/pull/591). + # AspNetCore 1.5.0 * Allow configuring Serializer security settings From d97e018965639633da7598188df297ece5338489 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 17 Jun 2026 05:05:45 +0000 Subject: [PATCH 2/2] Expand MessagePack section in AspNetCore README with XElement/Binary limitations Co-authored-by: Daniel-Svensson <3167509+Daniel-Svensson@users.noreply.github.com> --- .../Framework/README.md | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/OpenRiaServices.Hosting.AspNetCore/Framework/README.md b/src/OpenRiaServices.Hosting.AspNetCore/Framework/README.md index c08eff4a9..a5dbda467 100644 --- a/src/OpenRiaServices.Hosting.AspNetCore/Framework/README.md +++ b/src/OpenRiaServices.Hosting.AspNetCore/Framework/README.md @@ -142,6 +142,26 @@ builder.Services.AddOpenRiaServices() .AddMessagePackSerialization(); ``` +#### Known limitations + +The following types are **not** supported out of the box and require custom `MessagePackConverter` implementations registered via `MessagePackSerializationOptions.Serializer.Converters`: + +- **`System.Xml.Linq.XElement`** — not handled by the default serializer. See the [XElementConverter sample](https://github.com/OpenRIAServices/OpenRiaServices/blob/main/src/Test/AspNetCoreWebsite/MessagePack/XElementConverter.cs) for a reference implementation that serialises the element as a plain XML string. +- **`System.Data.Linq.Binary`** — not handled by the default serializer. See the [BinaryConverter sample](https://github.com/OpenRIAServices/OpenRiaServices/blob/main/src/Test/AspNetCoreWebsite/MessagePack/BinaryConverter.cs) for a reference implementation. + +Register the converters by passing a configuration callback: + +```csharp +builder.Services.AddOpenRiaServices() + .AddMessagePackSerialization(opt => + { + opt.Serializer = new Nerdbank.MessagePack.MessagePackSerializer() + { + Converters = [new XElementConverter(), new BinaryConverter()], + }; + }); +``` + ### Configuring serializer security quotas You can configure reader quotas to limit resource consumption and mitigate denial-of-service (DoS) attacks.