LivingDocGen.MSBuild 1.0.3

dotnet add package LivingDocGen.MSBuild --version 1.0.3
                    
NuGet\Install-Package LivingDocGen.MSBuild -Version 1.0.3
                    
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="LivingDocGen.MSBuild" Version="1.0.3">
  <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="LivingDocGen.MSBuild" Version="1.0.3" />
                    
Directory.Packages.props
<PackageReference Include="LivingDocGen.MSBuild">
  <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 LivingDocGen.MSBuild --version 1.0.3
                    
#r "nuget: LivingDocGen.MSBuild, 1.0.3"
                    
#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 LivingDocGen.MSBuild@1.0.3
                    
#: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=LivingDocGen.MSBuild&version=1.0.3
                    
Install as a Cake Addin
#tool nuget:?package=LivingDocGen.MSBuild&version=1.0.3
                    
Install as a Cake Tool

LivingDocGen.MSBuild

LivingDocGen.MSBuild is the MSBuild integration layer for LivingDocGen. It is distributed as the NuGet package LivingDocGen.MSBuild.

🎯 Purpose

This project provides the automatic integration with the .NET build and test process. When installed in a test project, it ensures that living documentation is generated automatically whenever tests are run.

📦 NuGet Package

  • Package ID: LivingDocGen.MSBuild
  • Description: Automatic living documentation generator for BDD test projects.

⚙️ How It Works

  1. Hooks into Build/Test: The package includes MSBuild .targets files (LivingDocGen.targets) that inject tasks into the build pipeline.
  2. Executes CLI: It bundles the LivingDocGen.CLI tool and executes it against the project's output.
  3. Zero Configuration: By default, it scans the project output for feature files and test results and generates living-documentation.html.

🔧 Configuration

You can configure the behavior using MSBuild properties in your .csproj file or by using a livingdocgen.json file in your project root.

Create a livingdocgen.json file in your project root:

{
  "enabled": true,
  "autoGenerate": "AfterTest",
  "paths": {
    "features": "./Features",
    "testResults": "./TestResults",
    "output": "./living-documentation.html"
  },
  "documentation": {
    "title": "My Project - Living Documentation",
    "theme": "purple",
    "primaryColor": "#9333ea"
  },
  "advanced": {
    "verbose": false,
    "includeSkipped": true,
    "includePending": true
  }
}

The MSBuild integration will automatically detect and use this file if it exists.

Option 2: MSBuild Properties

If no livingdocgen.json file is found, you can configure using MSBuild properties in your .csproj:

<PropertyGroup>
  
  <LivingDocConfigFile>$(ProjectDir)custom-config.json</LivingDocConfigFile>
  
  
  <LivingDocEnabled>true</LivingDocEnabled>
  
  
  <LivingDocOutput>$(OutputPath)docs/index.html</LivingDocOutput>
  
  
  <LivingDocTitle>My Project Specs</LivingDocTitle>
  
  
  <LivingDocTheme>blue</LivingDocTheme>
</PropertyGroup>

Priority Order:

  1. If LivingDocConfigFile exists → use config file
  2. If livingdocgen.json exists in project root → use it
  3. Otherwise → use MSBuild properties

🏗 Development

This project is responsible for:

  1. Packaging the LivingDocGen.CLI binaries into the tools/ folder of the NuGet package.
  2. Defining the MSBuild targets (LivingDocGen.targets) that run the tool.

Build Process

The .csproj contains a custom target CopyBDDCliToTools that copies the CLI build artifacts before packing.

<Target Name="CopyBDDCliToTools" BeforeTargets="_GetPackageFiles">
    
</Target>

📝 Todo List

  • Add conditional execution based on test run success/failure.
  • Improve error reporting when CLI execution fails.
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

  • .NETStandard 2.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
1.0.3 268 12/22/2025
1.0.1 219 12/22/2025