DocKiller 9.2.0

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

DocKiller

A plug-and-play library for .NET that automatically documents method calls using attributes. DocKiller scans decorated methods and generates JSON mapping with method names, descriptions, origin classes, and call graphs.

Features

  • Simple Attribute-Based Documentation: Decorate methods with [MethodDoc] to include them in documentation
  • Automatic Call Graph Detection: Tracks which documented methods call other documented methods
  • Hybrid Analysis: Supports both explicit call declarations (for async methods) and automatic IL-based detection (for sync methods)
  • JSON Output: Generates clean, structured JSON documentation
  • Cross-Layer Support: Works across all application layers (Domain, Application, Infrastructure, API)
  • Zero Configuration: Just install, decorate methods, and call one extension method

Installation

Install via NuGet Package Manager:

dotnet add package DocKiller

Or via Package Manager Console:

Install-Package DocKiller

Quick Start

1. Decorate Your Methods

Add the [MethodDoc] attribute to any method you want to document:

using DocKiller.Attributes;

public class ProductService
{
    [MethodDoc("Retrieves a paginated list of products from the database")]
    public async Task<List<Product>> GetPaginatedProductsAsync(int page, int pageSize)
    {
        // Your implementation
    }
}

2. Configure in Startup

In your Program.cs or startup configuration, add the documentation generation:

using DocKiller.Attributes;

var builder = WebApplication.CreateBuilder(args);

// Configure DocKiller to generate documentation
var outputPath = Path.Combine(Directory.GetCurrentDirectory(), "method-docs.json");
builder.Services.AddMethodDocumentation(outputPath);

var app = builder.Build();
app.Run();

3. Run Your Application

When your application starts, DocKiller will automatically generate a JSON file with all documented methods:

[
  {
    "method": "GetPaginatedProductsAsync",
    "description": "Retrieves a paginated list of products from the database",
    "originClass": "ProductService",
    "calledMethods": []
  }
]

Advanced Usage

Documenting Method Calls (Async Methods)

For async methods, use the Calls property to explicitly declare which documented methods are called:

public class ProductController : ControllerBase
{
    private readonly IProductService _productService;

    [MethodDoc("Returns paginated products based on filters",
               Calls = new[] { "GetPaginatedProductsAsync" })]
    public async Task<ActionResult<List<Product>>> GetProducts(int page, int pageSize)
    {
        var products = await _productService.GetPaginatedProductsAsync(page, pageSize);
        return Ok(products);
    }
}

public class ProductService : IProductService
{
    [MethodDoc("Retrieves a paginated list of products from the database")]
    public async Task<List<Product>> GetPaginatedProductsAsync(int page, int pageSize)
    {
        // Your implementation
    }
}

This generates:

[
  {
    "method": "GetProducts",
    "description": "Returns paginated products based on filters",
    "originClass": "ProductController",
    "calledMethods": ["GetPaginatedProductsAsync"]
  },
  {
    "method": "GetPaginatedProductsAsync",
    "description": "Retrieves a paginated list of products from the database",
    "originClass": "ProductService",
    "calledMethods": []
  }
]

Synchronous Methods (Automatic Detection)

For synchronous methods, DocKiller can automatically detect calls to other documented methods via IL analysis:

public class OrderService
{
    [MethodDoc("Calculates the total price of an order")]
    public decimal CalculateTotal(Order order)
    {
        var subtotal = CalculateSubtotal(order);
        var tax = CalculateTax(subtotal);
        return subtotal + tax;
    }

    [MethodDoc("Calculates the subtotal of order items")]
    public decimal CalculateSubtotal(Order order)
    {
        return order.Items.Sum(i => i.Price * i.Quantity);
    }

    [MethodDoc("Calculates tax on a given amount")]
    public decimal CalculateTax(decimal amount)
    {
        return amount * 0.1m;
    }
}

DocKiller will automatically detect that CalculateTotal calls both CalculateSubtotal and CalculateTax.

Filtering by Namespace

You can optionally filter documentation to specific namespaces:

var outputPath = Path.Combine(Directory.GetCurrentDirectory(), "method-docs.json");
builder.Services.AddMethodDocumentation(outputPath, namespaceFilter: "MyApp.Services");

How It Works

  1. Attribute Decoration: Methods are decorated with [MethodDoc] attribute
  2. Reflection Scanning: At startup, DocKiller uses reflection to find all decorated methods
  3. Call Analysis:
    • For methods with explicit Calls property: Uses the provided list
    • For other methods: Analyzes IL bytecode to detect method calls automatically
  4. JSON Generation: Creates a structured JSON file mapping all methods and their relationships

Why DocKiller?

  • Documentation as Code: Keep documentation close to implementation
  • Call Graph Visualization: Understand method dependencies at a glance
  • API Documentation: Generate endpoint documentation automatically
  • Code Analysis: Track method usage and dependencies
  • Integration Ready: JSON output can be consumed by other tools or UIs

Requirements

  • .NET 9.0 or higher
  • Any .NET project type (Web API, Console, Class Library, etc.)

License

MIT License - feel free to use in personal and commercial projects.

Contributing

Contributions are welcome! Please feel free to submit issues or pull requests.

Support

For issues, questions, or feature requests, please open an issue on the GitHub repository.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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. 
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
9.2.0 102 1/15/2026
9.0.8 208 12/24/2025
9.0.7 177 12/24/2025
9.0.6 272 12/17/2025
9.0.5 272 12/15/2025
9.0.0 211 12/14/2025
1.1.0 156 12/13/2025
1.0.0 163 12/13/2025