IoCTools.Abstractions
1.0.0
See the version list below for details.
dotnet add package IoCTools.Abstractions --version 1.0.0
NuGet\Install-Package IoCTools.Abstractions -Version 1.0.0
<PackageReference Include="IoCTools.Abstractions" Version="1.0.0" />
<PackageVersion Include="IoCTools.Abstractions" Version="1.0.0" />
<PackageReference Include="IoCTools.Abstractions" />
paket add IoCTools.Abstractions --version 1.0.0
#r "nuget: IoCTools.Abstractions, 1.0.0"
#:package IoCTools.Abstractions@1.0.0
#addin nuget:?package=IoCTools.Abstractions&version=1.0.0
#tool nuget:?package=IoCTools.Abstractions&version=1.0.0
IoCTools
IoCTools is a .NET source generator that lets services declare their own dependencies and lifetimes using small, focused attributes. It generates constructors and service registrations at build time — no runtime reflection, minimal boilerplate.
Quick Start
- Install
<PackageReference Include="IoCTools.Abstractions" Version="*" />
<PackageReference Include="IoCTools.Generator" Version="*" PrivateAssets="all" />
- Annotate a service
[Scoped]
public partial class EmailService : IEmailService
{
[Inject] private readonly ILogger<EmailService> _logger;
public Task SendAsync(string to, string subject, string body)
=> Task.CompletedTask;
}
- Register generated services
var builder = WebApplication.CreateBuilder(args);
// The method name is derived from your assembly: Add<YourAssemblyName>RegisteredServices
builder.Services.AddYourAssemblyNameRegisteredServices(builder.Configuration);
That’s it: IoCTools generates the constructor and service registrations.
Core Features
- Modern lifetimes:
[Scoped],[Singleton],[Transient] - Field injection:
[Inject]for DI services - Configuration injection:
[InjectConfiguration](values, sections, options) - Interface control:
RegisterAs<T...>,RegisterAsAll,SkipRegistration - Conditional registration:
[ConditionalService]by environment/config - Background services: auto-detect
BackgroundService/IHostedService - Diagnostics: actionable build-time checks
Docs
Start here: docs/index.md
- Getting Started: docs/getting-started.md
- Attributes & Usage: docs/attributes.md
- Lifetime Management: docs/lifetime-management.md
- Configuration Injection: docs/configuration-injection.md
- Conditional Services: docs/conditional-services.md
- Background Services: docs/background-services.md
- Interface Registration: docs/multi-interface-registration.md
- Generics: docs/generics.md
- Inheritance: docs/inheritance.md
- Diagnostics: docs/diagnostics.md
- Generator Style Options: docs/generator-style-options.md
- Recipes: docs/recipes.md
- FAQ: docs/faq.md
Sample
Browse IoCTools.Sample for end-to-end scenarios, including advanced patterns and background services.
License
MIT — see LICENSE.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.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 |
|---|---|---|
| 1.9.1 | 88 | 5/23/2026 |
| 1.8.0 | 1,192 | 5/12/2026 |
| 1.7.3 | 1,545 | 5/6/2026 |
| 1.7.2 | 88 | 5/6/2026 |
| 1.7.1 | 94 | 5/6/2026 |
| 1.6.1 | 98 | 4/29/2026 |
| 1.6.0 | 91 | 4/29/2026 |
| 1.5.1 | 143 | 4/12/2026 |
| 1.4.0 | 211 | 3/21/2026 |
| 1.3.0 | 118 | 1/24/2026 |
| 1.2.0 | 403 | 11/18/2025 |
| 1.1.0 | 294 | 11/12/2025 |
| 1.0.0 | 198 | 9/10/2025 |
| 1.0.0-alpha | 243 | 8/28/2025 |
| 0.4.1 | 177 | 11/30/2024 |
| 0.4.0 | 150 | 11/30/2024 |
| 0.3.0 | 213 | 3/18/2024 |
| 0.2.6 | 186 | 2/6/2024 |
| 0.2.5 | 308 | 2/6/2024 |
| 0.2.4 | 183 | 2/6/2024 |
v1.0.0: First stable release. Modern lifetime attributes, configuration injection, conditional registration, background services auto-detection, interface controls, and comprehensive diagnostics.