BrightSword.SwissKnife
2.0.0
dotnet add package BrightSword.SwissKnife --version 2.0.0
NuGet\Install-Package BrightSword.SwissKnife -Version 2.0.0
<PackageReference Include="BrightSword.SwissKnife" Version="2.0.0" />
<PackageVersion Include="BrightSword.SwissKnife" Version="2.0.0" />
<PackageReference Include="BrightSword.SwissKnife" />
paket add BrightSword.SwissKnife --version 2.0.0
#r "nuget: BrightSword.SwissKnife, 2.0.0"
#:package BrightSword.SwissKnife@2.0.0
#addin nuget:?package=BrightSword.SwissKnife&version=2.0.0
#tool nuget:?package=BrightSword.SwissKnife&version=2.0.0
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
- When is this library useful?
- Why use this approach?
- Capabilities
- How to use (for library users)
- Quick tasks
- Documentation
- Contributor Notes
- Publishing and Versioning
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:- TypeExtensions — reflection helpers
- Validator — argument/parameter guard helpers
- AttributeExtensions — attribute handling helpers
- EnumerableExtensions — collection helpers
- StringExtensions — string manipulation helpers
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 buildafter each change. - See
.github/copilot-instructions.mdfor 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.jsonandtools/bump_versions.pyhelper. - For CI/publish flows use the root
build.projtargets (for examplePublishSwissknife). See the repoPUBLISHING.mdfor full details.
| Product | Versions 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. |
-
net10.0
- System.Configuration.ConfigurationManager (>= 8.0.0)
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.