Ecosystem
The PowerCSharp Ecosystem
PowerCSharp is a modular .NET ecosystem published as 10+ NuGet packages across three architectural layers.
One rule governs the entire topology: dependency direction is unidirectional and upward. Higher layers depend on lower layers. Lower layers never depend on higher layers. This is enforced at the project reference level — the build fails if the rule is broken.
╔══════════════════════════════════════════════════════════════════╗
║ LAYER 3 — PLUGGABLE FEATURES (independently versioned) ║
║ ║
║ ┌────────────────────────────┐ ┌───────────────────────────┐ ║
║ │ Feature.Cache.BitFaster │ │ Feature.Cache.Disk │ ║
║ │ (isolates BitFaster.Cache) │ │ (zero third-party deps) │ ║
║ └──────────────┬─────────────┘ └───── ───┬─────────────────┘ ║
║ └──────────────┬───────────────┘ ║
║ ┌────────────────────────────┬┴──────────────────────────────┐ ║
║ │ Feature.Cache │ Feature.Cache.Abstractions │ ║
║ │ (module + options) │ (ICacheService, netstandard) │ ║
║ └────────────────────────────┴──────────────┬────────────────┘ ║
╠═════════════════════════════════════════════╪════════════════════╣
║ LAYER 2 — FEATURES FRAMEWORK │ ║
║ ┌───────────────────────────────────────────▼────────────────┐ ║
║ │ PowerCSharp.BuiltInFeatures (CORS + bundled capabilities) │ ║
║ └───────────────────────────────┬────────────────────────────┘ ║
║ ┌────────────────────────────────▼───────────────────────────┐ ║
║ │ PowerCSharp.Features (engine: discovery, flags, DI, diags) │ ║
║ └────────────────────────────────┬───────────────────────────┘ ║
║ ┌─────────────────────────────────▼──────────────────────────┐ ║
║ │ PowerCSharp.Features.Abstractions (zero NuGet deps) │ ║
║ └─────────────────────────────────┬──────────────────────────┘ ║
╠═══════════════════════════════════╪═════════════════════════════╣
║ LAYER 1 — CORE LIBRARY │ ║
║ ┌──────────────────────────────────▼─────────────────────────┐ ║
║ │ Extensions.AspNetCore (HTTP utils, URI, config binding) │ ║
║ └──────────────────────────────────┬───────────────────────── ┘ ║
║ ┌────────────────┐ ┌──────────────▼──┐ ┌───────────────────┐ ║
║ │ Extensions │ │ Utilities │ │ Helpers │ ║
║ │ (100+ methods) │ │ (validation, IO) │ │ (JSON, crypto) │ ║
║ └───────┬────────┘ └───────┬──────────┘ └────────┬──────────┘ ║
║ ┌───────▼────────────────────▼──────────────────────▼──────────┐ ║
║ │ PowerCSharp.Core (contracts + interfaces — zero deps) │ ║
║ └───────────────────────────────────────────────────────────────┘ ║
║ ┌──────────────────────────────────────────────────────────────┐ ║
║ │ PowerCSharp.Compatibility (.NET Framework 4.6.2+ bridge) │ ║
║ └──────────────────────────────────────────────────────────────┘ ║
╚══════════════════════════════════════════════════════════════════╝
Layer 1 — Core Library · PowerCSharpVersion
| Package | What it is | Install |
|---|---|---|
| PowerCSharp.Core | Contracts and interfaces. Zero dependencies. The foundation everything else builds on. | dotnet add package PowerCSharp.Core |
| PowerCSharp.Extensions | 100+ extension methods: strings, collections, DateTime, LINQ, IO, JSON, objects, types, streams. Includes Dynamic LINQ and CWE-73 compliant path operations. | dotnet add package PowerCSharp.Extensions |
| PowerCSharp.Extensions.AspNetCore | HTTP status helpers, URI manipulation, request cloning, ASP.NET Core configuration binding. | dotnet add package PowerCSharp.Extensions.AspNetCore |
| PowerCSharp.Utilities | Email/URL validation, file operations, math helpers. | dotnet add package PowerCSharp.Utilities |
| PowerCSharp.Helpers | JSON serialization (System.Text.Json), SHA-256/MD5 hashing, environment utilities. | dotnet add package PowerCSharp.Helpers |
| PowerCSharp.Compatibility | Bridges .NET Framework 4.6.2+ applications to modern API patterns. | dotnet add package PowerCSharp.Compatibility |
Target frameworks: .NET 8.0. Compatibility package also targets .NET Framework 4.6.2+ and .NET Standard 2.0.
Layer 2 — Features Framework · PowerCSharpFeaturesVersion
A module engine for runtime-toggled, flag-driven capabilities. Modules are discovered automatically from opted-in assemblies, gated by a composite flag resolver, and registered through standard ASP.NET Core DI.
| Package | What it is | Install |
|---|---|---|
| PowerCSharp.Features.Abstractions | Contracts only: IFeatureModule, IFeatureFlagProvider, FeatureDescriptor. Zero NuGet deps. netstandard2.0 + net8.0. |
dotnet add package PowerCSharp.Features.Abstractions |
| PowerCSharp.Features | The engine: assembly scanning, composite flag resolution, DI orchestration, feature registry, startup logging, opt-in diagnostics endpoint. | dotnet add package PowerCSharp.Features |
| PowerCSharp.BuiltInFeatures | Bundled ASP.NET Core capabilities activated by runtime flags. First built-in: CORS. | dotnet add package PowerCSharp.BuiltInFeatures |
Flag resolution order (highest to lowest precedence):
Code override → Custom IFeatureFlagProvider → Environment variables → appsettings → Feature default
Quick integration:
builder.Services.AddPowerFeatures(builder.Configuration, options =>
{
options.AddBuiltInFeatures();
options.ScanAssemblies(typeof(CacheFeatureModule).Assembly);
options.EnableDiagnosticsEndpoint(); // GET /power-features
});
app.UsePowerFeatures();

