Meziantou.Framework.PublicApiGenerator
2.0.2
Prefix Reserved
See the version list below for details.
dotnet add package Meziantou.Framework.PublicApiGenerator --version 2.0.2
NuGet\Install-Package Meziantou.Framework.PublicApiGenerator -Version 2.0.2
<PackageReference Include="Meziantou.Framework.PublicApiGenerator" Version="2.0.2" />
<PackageVersion Include="Meziantou.Framework.PublicApiGenerator" Version="2.0.2" />
<PackageReference Include="Meziantou.Framework.PublicApiGenerator" />
paket add Meziantou.Framework.PublicApiGenerator --version 2.0.2
#r "nuget: Meziantou.Framework.PublicApiGenerator, 2.0.2"
#:package Meziantou.Framework.PublicApiGenerator@2.0.2
#addin nuget:?package=Meziantou.Framework.PublicApiGenerator&version=2.0.2
#tool nuget:?package=Meziantou.Framework.PublicApiGenerator&version=2.0.2
Meziantou.Framework.PublicApiGenerator
Meziantou.Framework.PublicApiGenerator generates compilable C# files that represent the public API of a .NET assembly.
It can read metadata directly from a .dll or .exe (via PEReader and MetadataReader) or from a loaded Assembly. Both paths produce the same model and deterministic output.
Usage
using Meziantou.Framework.PublicApiGenerator;
var files = PublicApi.Generate(
assemblyPath: "/path/to/MyLibrary.dll",
options: new PublicApiOptions
{
FileLayout = PublicApiFileLayout.OneFilePerNamespace,
IncludeAutoGeneratedComment = false,
});
foreach (var file in files)
{
Console.WriteLine(file.RelativePath);
Console.WriteLine(file.Content);
}
Multi-target usage
You can merge multiple target frameworks into one output and emit conditional compilation blocks for target-specific differences:
using Meziantou.Framework.PublicApiGenerator;
var files = PublicApi.Generate(
assemblySources:
[
"/path/to/MyLibrary.netstandard2.0.dll",
"/path/to/MyLibrary.net10.0.dll",
]);
If needed, you can provide explicit framework monikers for specific entries:
using Meziantou.Framework.PublicApiGenerator;
var files = PublicApi.Generate(
assemblySources:
[
new AssemblySource("/path/to/MyLibrary.netstandard2.0.dll", ".NETStandard,Version=v2.0"),
new AssemblySource("/path/to/MyLibrary.net10.0.dll", ".NETCoreApp,Version=v10.0"),
]);
If TargetFrameworkMoniker is omitted (or empty), the generator infers it from assembly metadata.
Example output
Input API:
namespace Demo;
public sealed class Sample
{
public string? Echo(string? value) => value;
}
Generated API:
// Target Frameworks: net10.0
#nullable enable
namespace Demo
{
public sealed class Sample
{
public string? Echo(string? value) => throw null;
}
}
| Product | Versions 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. net11.0 is compatible. |
-
net10.0
- No dependencies.
-
net11.0
- No dependencies.
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 |
|---|---|---|
| 2.0.18 | 96 | 11/13/2026 |
| 2.0.17 | 90 | 11/13/2026 |
| 2.0.16 | 93 | 11/8/2026 |
| 2.0.15 | 162 | 10/31/2026 |
| 2.0.14 | 196 | 10/29/2026 |
| 2.0.13 | 106 | 10/28/2026 |
| 2.0.12 | 116 | 10/21/2026 |
| 2.0.11 | 102 | 10/14/2026 |
| 2.0.10 | 106 | 10/11/2026 |
| 2.0.9 | 122 | 10/9/2026 |
| 2.0.8 | 111 | 9/27/2026 |
| 2.0.7 | 117 | 9/11/2026 |
| 2.0.6 | 124 | 9/6/2026 |
| 2.0.5 | 143 | 9/3/2026 |
| 2.0.4 | 129 | 8/29/2026 |
| 2.0.3 | 135 | 8/9/2026 |
| 2.0.2 | 132 | 7/12/2026 |
| 2.0.1 | 133 | 7/8/2026 |
| 2.0.0 | 145 | 7/5/2026 |
| 1.0.8 | 142 | 7/5/2026 |