ServiceModel.Grpc.MemoryPackMarshaller 1.11.1

dotnet add package ServiceModel.Grpc.MemoryPackMarshaller --version 1.11.1                
NuGet\Install-Package ServiceModel.Grpc.MemoryPackMarshaller -Version 1.11.1                
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="ServiceModel.Grpc.MemoryPackMarshaller" Version="1.11.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ServiceModel.Grpc.MemoryPackMarshaller --version 1.11.1                
#r "nuget: ServiceModel.Grpc.MemoryPackMarshaller, 1.11.1"                
#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.
// Install ServiceModel.Grpc.MemoryPackMarshaller as a Cake Addin
#addin nuget:?package=ServiceModel.Grpc.MemoryPackMarshaller&version=1.11.1

// Install ServiceModel.Grpc.MemoryPackMarshaller as a Cake Tool
#tool nuget:?package=ServiceModel.Grpc.MemoryPackMarshaller&version=1.11.1                

ServiceModel.Grpc.MemoryPackMarshaller

ServiceModel.Grpc enables applications to communicate with gRPC services using a code-first approach (no .proto files), helps to get around limitations of gRPC protocol like "only reference types", "exact one input", "no nulls", "no value-types". Provides exception handling. Helps to migrate existing WCF solution to gRPC with minimum effort.

ServiceModel.Grpc.MemoryPackMarshaller is package with IMarshallerFactory implementation, based on MemoryPack serializer.

Configure ClientFactory

Instruct ClientFactory to use MemoryPackMarshallerFactory as default marshaller for all clients.

IClientFactory defaultClientFactory
    = new ClientFactory(new ServiceModelGrpcClientOptions
    {
        // set MemoryPackMarshaller as default Marshaller
        MarshallerFactory = MemoryPackMarshallerFactory.Default
    });

Instruct ClientFactory to use MemoryPackMarshallerFactory for concrete client.

// client factory with default (DataContractMarshallerFactory) marshaller
IClientFactory defaultClientFactory = new ClientFactory();

// set MemoryPackMarshaller only for ICalculator client
defaultClientFactory.AddClient<ICalculator>(options =>
{
    options.MarshallerFactory = MemoryPackMarshallerFactory.Default;
});

Configure ServiceModel.Grpc.AspNetCore

Instruct ServiceModel.Grpc code-first to use MemoryPackMarshallerFactory as default marshaller for all endpoints.

var builder = WebApplication.CreateBuilder();

// enable ServiceModel.Grpc code-first
builder.Services.AddServiceModelGrpc(options =>
{
    // set MemoryPackMarshaller as default Marshaller
    options.DefaultMarshallerFactory = MemoryPackMarshallerFactory.Default;
});

Instruct ServiceModel.Grpc code-first to use MemoryPackMarshallerFactory for concrete endpoint.

var builder = WebApplication.CreateBuilder();

// enable ServiceModel.Grpc code-first with default (DataContractMarshallerFactory) marshaller
builder.Services.AddServiceModelGrpc();

// set MemoryPackMarshaller only for Calculator endpoint
builder.Services.AddServiceModelGrpcServiceOptions<Calculator>(options =>
{
    options.MarshallerFactory = MemoryPackMarshallerFactory.Default;
});

Configure ServiceModel.Grpc.SelfHost

Instruct ServiceModel.Grpc code-first to use MemoryPackMarshallerFactory.

var server = new Grpc.Core.Server();

// set MemoryPackMarshaller for Calculator endpoint
server.Services.AddServiceModelTransient(
    ()=> new Calculator(),
    options =>
    {
        options.MarshallerFactory = MemoryPackMarshallerFactory.Default;
    });
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.11.1 77 11/30/2024
1.11.0 90 11/23/2024
1.10.1 113 10/19/2024