BrightSword.SwissKnife 2.0.0

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

BrightSword.SwissKnife

BrightSword.SwissKnife is a collection of small, reusable utility and extension helpers for .NET, used across the BrightSword projects. It is designed to maximize developer productivity and code clarity by providing robust, dependency-light helpers for common programming tasks.


Table of Contents


Overview

BrightSword.SwissKnife provides a set of extension methods and helpers for reflection, validation, collections, string manipulation, and more. It is intended to be reusable, dependency-light, and suitable for use in any .NET project.


When is this library useful?

  • When you need robust, well-tested extension methods for common .NET types (collections, strings, reflection, etc.).
  • When you want to avoid reinventing utility code for argument validation, type inspection, or attribute handling.
  • When you want to maximize productivity and code clarity by using proven helpers.

Why use this approach?

  • Developer Productivity: SwissKnife reduces code-bloat and improves maintainability by centralizing common helpers and extension methods. Instead of writing custom logic for every project, you reuse the tested utilities.
  • Reusability: The library is designed to be dependency-light and broadly applicable, making it easy to adopt in any .NET solution.
  • Reliability: Helpers are used across multiple BrightSword projects and are tested in real-world scenarios.

Capabilities

  • Reflection helpers for type/property inspection (TypeExtensions, AttributeExtensions).
  • Argument/parameter guard helpers (Validator).
  • Collection and string extension methods (EnumerableExtensions, StringExtensions).
  • Utility classes for common patterns (disposable, monads, bit twiddling, etc.).
  • Per-class documentation and copyable examples in the docs/ folder.

How to use (for library users)

  • Reference the library in your project and use the extension methods and helpers as needed.
  • See the docs/ folder for per-class documentation and examples:

Quick tasks

  • Build:
    dotnet build BrightSword.SwissKnife.sln -c Release
    
  • Pack locally (produces .nupkg in artifacts):
    dotnet pack BrightSword.SwissKnife\BrightSword.SwissKnife.csproj -c Release -o ..\artifacts
    
  • Tests:
    dotnet test BrightSword.SwissKnife.Tests -c Release
    

Documentation

This library includes per-class documentation in the docs/ folder. Key topics:

See each file in BrightSword.SwissKnife/docs/ for detailed usage, implementation notes, and copyable examples.


Contributor Notes

  • SwissKnife is intended to be dependency-light and broadly reusable. Avoid introducing heavy dependencies or project-specific logic.
  • Extension methods should be well-tested and follow .NET conventions for naming and behavior.
  • When refactoring, preserve public API shapes unless intentionally bumping versions. The projects track assembly/file versions in csproj files.
  • Prefer small, local refactors and run dotnet build after each change.
  • See .github/copilot-instructions.md for more contributor guidance and architectural notes.

Publishing and Versioning

  • This project is packaged independently as BrightSword.SwissKnife.
  • Versioning is managed by the repo-level versions.json and tools/bump_versions.py helper.
  • For CI/publish flows use the root build.proj targets (for example PublishSwissknife). See the repo PUBLISHING.md for full details.
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.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on BrightSword.SwissKnife:

Package Downloads
BrightSword.Squid

Super QUantum Interface serialization and Deserialization - Advanced interface serialization library

BrightSword.Feber

Fast Expression Based Extensions for Reflection

BrightSword.Packages

Composite package bundling all BrightSword libraries: SwissKnife, Crucible, Feber, and Squid

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.0 102 3/2/2026
Loading failed