ZeroC.Slice.Codec 0.6.0

Prefix Reserved
dotnet add package ZeroC.Slice.Codec --version 0.6.0
                    
NuGet\Install-Package ZeroC.Slice.Codec -Version 0.6.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="ZeroC.Slice.Codec" Version="0.6.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ZeroC.Slice.Codec" Version="0.6.0" />
                    
Directory.Packages.props
<PackageReference Include="ZeroC.Slice.Codec" />
                    
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 ZeroC.Slice.Codec --version 0.6.0
                    
#r "nuget: ZeroC.Slice.Codec, 0.6.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 ZeroC.Slice.Codec@0.6.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=ZeroC.Slice.Codec&version=0.6.0
                    
Install as a Cake Addin
#tool nuget:?package=ZeroC.Slice.Codec&version=0.6.0
                    
Install as a Cake Tool

The Slice serialization library

Slice is a serialization format for structured data: it allows you to encode structured data into streams of bytes and later decode these bytes to recreate the structured data.

Slice is also a modern Interface Definition Language (IDL): you define your structured data with the Slice IDL and then use the Slice compiler to generate code that encodes/decodes this structured data to/from bytes in Slice format.

In C#, the Slice compiler for C# generates code that relies on this ZeroC.Slice.Codec serialization library.

Unlike older C# libraries, ZeroC.Slice.Codec relies on System.Buffers (IBufferWriter<byte>, ReadOnlySequence<byte>) and is typically used with the Pipelines library.

Package | Source code | Documentation | API reference

Sample Code

// Slice definition

struct Person {
    name: string
    id: int32
    tag(1) email: string?
}
// Generated by the Slice compiler for C#

public partial record struct Person
{
    public required string Name { get; set; }

    public int Id { get; set; }

    public string? Email { get; set; }

    /// <summary>Constructs a new instance of <see cref="Person" />.</summary>
    [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
    public Person(string name, int id, string? email)
    {
        this.Name = name;
        ...
    }

    /// <summary>Constructs a new instance of <see cref="Person" /> and decodes its fields
    /// from a Slice decoder.</summary>
    /// <param name="decoder">The Slice decoder.</param>
    [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
    public Person(ref SliceDecoder decoder)
    {
        this.Name = decoder.DecodeString();
        ...
    }

    /// <summary>Encodes the fields of this struct with a Slice encoder.</summary>
    /// <param name="encoder">The Slice encoder.</param>
    public readonly void Encode(ref SliceEncoder encoder)
    {
        encoder.EncodeString(this.Name);
        ...
    }
}
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.
  • net10.0

NuGet packages (2)

Showing the top 2 NuGet packages that depend on ZeroC.Slice.Codec:

Package Downloads
IceRpc

IceRPC for C#.

IceRpc.Slice

IceRPC + Slice integration for C#

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.6.0 118 6/5/2026