Skip to content

2.0.0

Choose a tag to compare

@Astn Astn released this 28 Sep 07:51
· 3 commits to master since this release
80ef82d

2.0.0, released 2026-09-28 from master 80ef82d (tag v2.0.0). Published by the trusted-publishing run 36393253886.

Packages

Package Version Targets
AustinHarris.JsonRpc 2.0.0 netstandard2.0, netstandard2.1, net8.0, net10.0
AustinHarris.JsonRpc.AspNetCore 2.0.0 net8.0, net10.0
AustinHarris.JsonRpc.SystemTextJson 2.0.0 netstandard2.0, netstandard2.1, net8.0, net10.0
AustinHarris.JsonRpc.Newtonsoft 2.0.0 netstandard2.0, netstandard2.1, net8.0, net10.0

The four packages carry one version and are released together; use matching versions. All four assemblies are strong-named with one key (public key token e6819c02cf4aec44) that stays fixed from here on. Symbol packages are on the NuGet symbol server. The built-in serializer's tokenizer is a C# port of jsmn by Serge A. Zaitsev (MIT); its copyright and permission notice is in THIRD-PARTY-NOTICES.txt in the repository and ships inside the AustinHarris.JsonRpc package from the next version.

What 2.0.0 is

The request pipeline is built around UTF-8 bytes: ReadOnlySequence<byte>, ReadOnlyMemory<byte> or ReadOnlySpan<byte> in, IBufferWriter<byte> out, parameters bound from the request bytes through compiled invokers. The JSON serializer is pluggable; the built-in serializer is the default and Json.NET and System.Text.Json ship as packages. Task and ValueTask methods are supported again through ProcessAsync, with sequential batches and cooperative cancellation. The AspNetCore package hosts in Kestrel over HTTP and raw connections with DI registration. Document and batch limits are on by default, reserved method names are refused at registration, unknown named parameters are rejected, and an error handler receives the exception the method threw.

The full list is the 2.0.0 section of the changelog: Added, Changed, Deprecated, Removed, Fixed and Security. Moving a 1.x server: Upgrading from 1.x.

Performance

Measured in one job on one 32-core Hugging Face Jobs cpu-performance host (AMD EPYC 7R13), job astnh/6ab9b3936b030d633f69b0fb, 2026-09-28, low to high over the job's runs. The figures, charts and explorer are regenerated from that job's data (benchmarks/hf/, benchmarks/charts/).

Path RPC/s Against 1.2.3
1.2.3, Task<string> Process(string), thread pool, best batch size 1.29 M to 2.41 M
2.0, the same string API and the same loop 9.83 M to 11.1 M 6.0×
2.0, Process(bytes), 32 dedicated threads 44.2 M to 45.7 M 24.3×
2.0, ProcessAsync(bytes), 32 awaited workers 36.3 M to 40.5 M 20.7×
2.0, Kestrel TCP, 32 pipelined clients 18.5 M

Release gate on the same job: --scale 3 32 4.0 (the ProcessAsync path at N workers over 1) 12.2 / 12.1 / 13.1 for the sync/None, Task and ValueTask registrations, floor 4.0. No request-path file changed between that job and this release, so the run stands as the release measurement.

Feature costs recorded in the changelog: RpcContextFlow.Flow costs one allocation per invocation for the execution-context bridge (None, the default, allocates nothing); scoped or transient services cost one container scope per document on raw connections; ProcessAsync keeps one scratch per thread that has run it plus 64 shared, buffers at most 64 KiB each.

Deprecations and migrations

Config.SetBeforeProcessHandler (JSONRPC0001), Handler.RegisterFuction (JSONRPC0002) and Handler.UnRegisterFunction (JSONRPC0003) are obsolete at warning level, each with a link to its replacement on the obsoletions page. They stay through 2.x and are removed in 3.0. InProcessClient and the JsonSerializerSettings overloads are removed; the 1.x projects that 2.0 did not build are gone from the tree. Every source and wire change a 1.x server meets is in the upgrading guide.

Known limitations

  • No per-call deadline in the core: the host owns it (request-timeouts middleware on HTTP; a linked token on a raw or in-process host).
  • No client, no server-to-client calls, no wire cancellation, no service description: these are the 2.x minor train (client 2.3, description 2.4, duplex 2.6, cancellation 2.7).
  • Trimming and Native AOT are unsupported until the library is annotated (2.1) and source-generated bindings ship (2.8); a host that publishes trimmed or with PublishAot sees trim warnings from the reflection binder.
  • Raw-connection replies carry no newline or Content-Length framing; a client that needs either uses a host that adds it (samples/EmbeddedHost).

Verification

  • CI on the release pull request (#178): Release build and tests on windows-latest and ubuntu-latest for net8.0 and net10.0, the request-path synchronization check; the non-blocking scaling probe on the 4-vCPU runner is noise and not a gate.
  • API freeze: the published surface (docs/api-surface/2.0.0.txt) differs from the frozen 2.0.0-preview.3 surface in the four informational-version lines only.
  • Package verification (AUS-1013 on preview.3, repeated on 2.0.0): the four packages restore from nuget.org on net8.0 and net10.0 into a fresh folder; every link in the nuspecs and READMEs resolves; the three obsoletion anchors are present; a 1.x host upgraded following the guide; a Kestrel host answered over HTTP and TCP; the WebAssembly sample answered in the browser from the packaged core.
  • Trim and AOT: not validated in this release (see Known limitations).

Documentation: https://astn.github.io/JSON-RPC.NET/ (README, API and hosting reference, changelog, upgrading, serializers, obsoletions, samples, benchmark explorer).