Skip to main content
Any Framework

CLI to generate compilable C# public API stubs from .NET assemblies.

Published
Apr 27, 2026
5mo ago
Total Downloads
4.2K
4,182

Install

dotnet add package Meziantou.Framework.PublicApiGenerator.Tool --version 1.0.1

No framework information available.

README

Meziantou.Framework.PublicApiGenerator.Tool

Meziantou.Framework.PublicApiGenerator.Tool is a CLI tool that reads a .NET .dll or .exe and generates compilable C# files describing its public API.

Install

dotnet tool install --global Meziantou.Framework.PublicApiGenerator.Tool

Example

Meziantou.Framework.PublicApiGenerator.Tool \
  --input ./bin/Release/net8.0/MyLibrary.dll \
  --output ./public-api \
  --file-layout OneFilePerNamespace \
  --omit-auto-generated-comment

Multi-target example:

Meziantou.Framework.PublicApiGenerator.Tool \
  --input netstandard2.0=./bin/Release/netstandard2.0/MyLibrary.dll \
  --input net8.0=./bin/Release/net8.0/MyLibrary.dll \
  --output ./public-api \
  --omit-auto-generated-comment

When using multiple --input values, you can use tfm=path to set the target framework explicitly, or use plain paths and let the tool infer target frameworks from assembly metadata (TargetFrameworkAttribute).

Example output

public-api/
  Demo.g.cs
  GlobalNamespace.g.cs
Description:
  Generate public API stubs from a .NET assembly.

Usage:
  Meziantou.Framework.PublicApiGenerator.Tool [options]

Options:
  --input <input> (REQUIRED)                                     Assembly input. Use either 'path' or 'tfm=path'. Repeat for multi-target generation.
  --output <output> (REQUIRED)                                   Output directory
  --file-layout <OneFilePerNamespace|OneFilePerType|SingleFile>  File layout: SingleFile, OneFilePerNamespace, or OneFilePerType [default: SingleFile]
  --omit-auto-generated-comment                                  Omit the // <auto-generated/> comment from generated files
  -?, -h, --help                                                 Show help and usage information
  --version                                                      Show version information

Adoption Assessment

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

No target framework metadata is available. Confirm compatibility in a representative project before standardising on this package.

Related Guides & Workflows

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