CallgraphClosure 0.1.0-preview1

This is a prerelease version of CallgraphClosure.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package CallgraphClosure --version 0.1.0-preview1
                    
NuGet\Install-Package CallgraphClosure -Version 0.1.0-preview1
                    
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="CallgraphClosure" Version="0.1.0-preview1">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CallgraphClosure" Version="0.1.0-preview1" />
                    
Directory.Packages.props
<PackageReference Include="CallgraphClosure">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
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 CallgraphClosure --version 0.1.0-preview1
                    
#r "nuget: CallgraphClosure, 0.1.0-preview1"
                    
#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 CallgraphClosure@0.1.0-preview1
                    
#: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=CallgraphClosure&version=0.1.0-preview1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=CallgraphClosure&version=0.1.0-preview1&prerelease
                    
Install as a Cake Tool

CallgraphClosure

Meta-package for the CallgraphClosure family of Roslyn property analyzers. Installing this pulls in all four current properties at once.

Pre-release. Early-stage. The properties enforce contracts across the transitive call closure of annotated methods.

Install

dotnet add package CallgraphClosure --prerelease

What you get

Package Attribute Catches
CallgraphClosure.MustNotAllocate [MustNotAllocate] Allocations (newobj/newarr/box) anywhere in the transitive closure
CallgraphClosure.MustNotThrow [MustNotThrow] Throw statements anywhere in the transitive closure
CallgraphClosure.MustNotBlock [MustNotBlock] Thread.Sleep, Task.Wait/.Result, sync-over-async anywhere in the transitive closure
CallgraphClosure.MustNotRecurse [MustNotRecurse] Direct recursion plus transitive cycles

Each property also reports CGC001 for calls into unannotated user methods (the missing-annotation contract violation) and CGC002 for calls into external/BCL methods (which can be resolved by the optional CallgraphClosure.ILCheck post-pass).

Want only one property?

If you don't want all four, install the specific package(s) you need instead — each works standalone.

dotnet add package CallgraphClosure.MustNotAllocate --prerelease

Repo

github.com/pawlos/covenant — full design notes, IL post-pass details, ROADMAP, and the writeup explaining the technique.

MIT licensed.

There are no supported framework assets in this 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.1.0-preview2 80 5/25/2026
0.1.0-preview1 91 5/18/2026