Nullean.Snapshots.PublicApi 0.13.0

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

Nullean.Snapshots.PublicApi

snapshots.

Public API snapshots for Nullean.Snapshots: an assembly's public API stored as a .api file, C# one declaration per line, and every change reported by path with the version change it calls for, who it breaks and where in the verified file.

NuGet

Install

dotnet add package Nullean.Snapshots.PublicApi

Quick start

using AwesomeAssertions;
using Nullean.Snapshots.PublicApi;

public class ApiTests
{
	[Test]
	public void Public_api_is_unchanged() => typeof(Widget).Assembly.Should().MatchApiSnapshot();
}

The first run writes ApiTests/Public_api_is_unchanged.received.api. Accept it, and from then on a change to the API fails the test until the new file is accepted:

Public API did not match snapshot: tests/Acme.Tests/.snapshots/ApiTests/Public_api_is_unchanged.verified.api
Suggested version change: Major (2 breaking)
2 difference(s):
Lib.Drawing › IShape › Resize(double)  added void Resize(double factor)  [major: breaks implementers, compiled code and source]   (verified.api:4)
Lib.Drawing › Widget › Name(int) › parameter 1 name  index → position  [major: breaks callers, source only] (callers that pass it by name)   (verified.api:12)

The verified file reads like the code:

assembly Lib
using interface System: IDisposable

namespace Lib.Drawing
  interface IShape : IDisposable
    double Area { get; }
    void Draw()

  class Widget : IShape
    Widget(string name)
    double Area { get; }
    void Draw()
    string Name(int index)

Options

  • split: ApiSplit.Namespace (or TopLevelNamespace) keeps a snapshot per namespace, named after it, for a large assembly.
  • comparison: new ApiComparisonOptions { NotExtensionPoints = ["Lib.Internal.*"] } names types nobody outside implements or derives from: a change that only breaks their implementers is listed but does not ask for a major version. A type with an attribute named InternalImplementationOnlyAttribute counts as one too.

The reading, writing and comparing come from Nullean.PublicApi and Nullean.PublicApi.Diff, the engine of assembly-differ, whose api --verify checks the same files from a build.

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.  net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
0.13.0 0 11/14/2026