Skip to main content

ProtoBuf DSL (proto2 / proto3) and descriptor tools for protobuf-net

Total Downloads
29.7M
29,741,509
Published
Oct 21, 2026
26d ago

Get Started

dotnet add package protobuf-net.Reflection --version 3.4.40
ProductVersions
.NET Standard
netstandard2.0
Other
.NETFramework4.6.2

README

protobuf-net.Reflection

The .proto schema tooling behind protobuf-net, as a library: parse proto2/proto3 schemas into a FileDescriptorSet, inspect or manipulate the descriptors, and generate C# or VB source from them.

var set = new FileDescriptorSet();
set.AddImportPath(".");
set.Add("person.proto", includeInOutput: true);
set.Process();

foreach (var file in CSharpCodeGenerator.Default.Generate(set))
{
    Console.WriteLine(file.Name);
    Console.WriteLine(file.Text);
}

The common imports (google/protobuf/*.proto and friends) are embedded, so they resolve without being on disk. This is the same code generation used by the protogen command-line tool and by protobuf-net.dev; if you just want generated types, prefer one of those, or the build-time generation described below.

More

Downloads by Version

Similar & Alternative Packages

Hand-picked matching NuGet libraries based on tags & ecosystem

Depended On By

Find packages that declare this package as a dependency. NuGet does not provide a reverse-dependency endpoint, so candidates are checked on demand.

Adoption Assessment

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

Compatibility metadata lists 2 target frameworks; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.