Tharga.Runtime
Assembly scanning, runtime type discovery, and filter-based dependency injection for .NET 8 / 9 / 10. Provides IAssemblyService (cached type lookups across loaded assemblies), filter-based IServiceCollection extensions for registering many implementations of an interface in one call, and a small set of Type helpers used across Tharga libraries.
Package
| Package | What it does |
|---|---|
| Tharga.Runtime | Assembly/type scanning, cached GetTypes lookups, and filter-based DI registration. |
Quick start
dotnet add package Tharga.Runtime
Register the cache-backed assembly service:
using Tharga.Runtime;
builder.Services.AddAssemblyService();
Or skip IAssemblyService and register every implementation of a base type in one line:
builder.Services.AddSingleton<IMyHandler>(x => !x.IsAbstract);
What's in the box
IAssemblyService— cached, filterable type discovery across loaded assemblies. See Assembly service.IServiceCollectionfilter extensions —Add,AddTransient,AddScoped,AddSingletonoverloads that scan and register types matching aTypeInfofilter. See Service registration.Typehelpers —IsOfType,GetDirectlyImplementedInterfaces,ToAssemblyQualifiedNameWithoutVersion, and version-tolerantGetType(string). See Type extensions.
Repo
github.com/Tharga/Runtime — source, issues, releases.