Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ProwlEngine/Prowl.Echo/llms.txt

Use this file to discover all available pages before exploring further.

Prowl.Echo is distributed as a single NuGet package that includes both the runtime library and the bundled source generator. There is no separate analyzer package to install — everything you need for zero-reflection, compile-time serialization ships in one reference.

Supported Frameworks

The Prowl.Echo package targets multiple frameworks and the NuGet toolchain automatically selects the correct build for your project. No manual framework selection is required.
FrameworkSupported
.NET 6.0
.NET 7.0
.NET 8.0
.NET 9.0

Installing via the .NET CLI

Run the following command in the directory containing your .csproj file:
dotnet add package Prowl.Echo
This adds the latest stable version of Prowl.Echo to your project and restores the package automatically.

Installing via PackageReference

Add the following entry to the <ItemGroup> in your .csproj file to pin to the current stable release:
<ItemGroup>
  <PackageReference Include="Prowl.Echo" Version="2.2.1" />
</ItemGroup>
After saving the file, run dotnet restore (or let your IDE restore automatically) to download the package.

The Bundled Source Generator

The Prowl.Echo NuGet package ships the Echo.SourceGenerator Roslyn analyzer inside the analyzers/dotnet/cs package path. When you reference Prowl.Echo, the source generator is registered automatically — no additional <PackageReference> entry, no IsPackable flag, and no manual analyzer registration is needed. To activate source generation for a type, annotate it with [GenerateSerializer] and declare the type as partial:
using Prowl.Echo;

[GenerateSerializer]
public partial class SaveData
{
    public string PlayerName = "";
    public int Level = 1;
    public float PlaytimeHours = 0f;
}
The partial keyword is required for [GenerateSerializer] to work. The source generator emits a second partial declaration that adds the ISerializable implementation alongside your own code. If partial is absent the build will fail with a generator diagnostic.
The generator supports classes and structs. For small, fixed-layout value types, combine [GenerateSerializer] with [FixedEchoStructure] to enable compact positional serialization that omits field names entirely:
<!-- Complete .csproj example with Prowl.Echo -->
<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Prowl.Echo" Version="2.2.1" />
  </ItemGroup>

</Project>

Verifying the Installation

After installing, add the following snippet to confirm that both the runtime and source generator are working correctly:
using Prowl.Echo;

[GenerateSerializer]
public partial class Ping
{
    public string Message = "hello";
}

var echo = Serializer.Serialize(new Ping());
var result = Serializer.Deserialize<Ping>(echo)!;
Console.WriteLine(result.Message); // hello
If the project builds without errors and prints hello, Prowl.Echo is installed and the source generator is active.

Build docs developers (and LLMs) love