WinterRose.ForgeGuard 25.4.0

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

A unit-test-like system thats designed for production runtime application healthchecks. but can also be used for developers to unit test their app

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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.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
25.4.0 438 12/9/2025
25.2.1 202 6/4/2025
25.2.0 195 6/2/2025

Features
ForgeGuard Core Class
Automatically discovers and executes guard tests defined across loaded assemblies.

Attribute-Driven Guard System

[GuardClass] to mark types containing guards

[Guard] for test-like methods. with an optional constructor overload to define severity. defaults to Catastrophic

[GuardSetup] / [GuardTeardown] for per-class setup and teardown

[GlobalSetup] / [GlobalTeardown] for once-per-run hooks

[Fatal] to mark guards that should abort the app on failure

Severity-Aware Execution
Guard methods can be tagged with severity levels to reflect the criticality of a failure.

ForgeGuard.RunGuards(Stream)
Execute all guard classes and emit structured diagnostic output to a stream.

Production-Safe Checks
Ideal for runtime verification of invariants, environment sanity, or post-start health validation.

ANSI Color Formatting
Toggle ForgeGuard.IncludeColorInMessageFormat for easy-to-read terminal output.





Added XML documentation to all methods (i think)
added a way to tag guard classes, and to only run guards tagged with a specified tag.
ForgeGuard now throws exceptions when no guards are found in the loaded assemblies, or when no guard with one of the specified tags was found