Polhem.JsonRpc.Server 1.1.0

dotnet add package Polhem.JsonRpc.Server --version 1.1.0
                    
NuGet\Install-Package Polhem.JsonRpc.Server -Version 1.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Polhem.JsonRpc.Server" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Polhem.JsonRpc.Server" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Polhem.JsonRpc.Server" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Polhem.JsonRpc.Server --version 1.1.0
                    
#r "nuget: Polhem.JsonRpc.Server, 1.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Polhem.JsonRpc.Server@1.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Polhem.JsonRpc.Server&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Polhem.JsonRpc.Server&version=1.1.0
                    
Install as a Cake Tool

Polhem.JsonRpc.Server

A transport-independent JSON-RPC 2.0 dispatcher on System.Text.Json: ProgId.Action methods on objects the application creates, a naming convention for callable methods, parameter binding, filters, batches and notifications, and an in-process transport.

Most applications reference Polhem.JsonRpc.AspNetCore instead, which hosts this dispatcher on an HTTP endpoint. Reference this package directly for another host.

var dispatcher = new JsonRpcDispatcher(new JsonRpcServerOptions { ObjectFactory = new AppObjectFactory() });

// "Calculator.Add": the factory creates the object for the ProgId "Calculator", and Add is called on it.
public sealed class AppObjectFactory : IJsonRpcObjectFactory
{
    public object? CreateObject(string progId, JsonRpcRequestContext context) =>
        progId == "Calculator" ? new Calculator() : null;
}

public sealed class Calculator
{
    public AddResponse Add(AddRequest request) => new() { Sum = request.A + request.B };   // {Action}Request -> {Action}Response
}

The dispatcher resolves methods by reflection, so it does not support Native AOT.

Documentation and samples: https://github.com/polhem-dev/polhem-jsonrpc

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Polhem.JsonRpc.Server:

Package Downloads
Polhem.Api.Core

The JSON-RPC 2.0 layer of the Polhem framework: request and response messages, the payload codecs, compression and encryption, and the server-side dispatcher.

Polhem.JsonRpc.AspNetCore

ASP.NET Core endpoint for Polhem.JsonRpc.Server: MapJsonRpc and the HTTP request handler.

Polhem.JsonRpc.Payload.Server

Server half of Polhem.JsonRpc.Payload: a dispatcher filter that opens the payload envelope, checks the replay-protection frame and seals the result.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.0 0 10/4/2026
1.0.0 72 10/3/2026
0.1.0 38 10/2/2026