CallgraphClosure 0.1.0-preview2
dotnet add package CallgraphClosure --version 0.1.0-preview2
NuGet\Install-Package CallgraphClosure -Version 0.1.0-preview2
<PackageReference Include="CallgraphClosure" Version="0.1.0-preview2"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="CallgraphClosure" Version="0.1.0-preview2" />
<PackageReference Include="CallgraphClosure"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add CallgraphClosure --version 0.1.0-preview2
#r "nuget: CallgraphClosure, 0.1.0-preview2"
#:package CallgraphClosure@0.1.0-preview2
#addin nuget:?package=CallgraphClosure&version=0.1.0-preview2&prerelease
#tool nuget:?package=CallgraphClosure&version=0.1.0-preview2&prerelease
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.
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- CallgraphClosure.MustNotAllocate (>= 0.1.0-preview2)
- CallgraphClosure.MustNotBlock (>= 0.1.0-preview2)
- CallgraphClosure.MustNotRecurse (>= 0.1.0-preview2)
- CallgraphClosure.MustNotThrow (>= 0.1.0-preview2)
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 |