MVFC.Pack.IoC 4.0.0

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

MVFC.Pack.IoC

🇧🇷 Leia em Português · ← Back to MVFC.Pack

License Platform NuGet Version NuGet Downloads

Metapackage for Dependency Injection setup — source-generated mediator registration, automatic service scanning, FluentValidation DI integration and resilient HTTP clients.

Motivation

Configuring the IoC container in a modern- .NET 9+ microservice involves the same repetitive steps: registering MediatR handlers, wiring FluentValidation into DI, scanning and registering services automatically, and building resilient HTTP clients with Polly.

MVFC.Pack.IoC centralizes all of this. The source generators activate at compile time — meaning zero reflection overhead at runtime — and the resilience pipeline follows the .NET standard patterns out of the box.

Installation

dotnet add package MVFC.Pack.IoC

Quick Start

// 1. MediatR registration
builder.Services.AddMediatR(cfg =>
    cfg.RegisterServicesFromAssemblyContaining<Program>());

// 2. Automatic service scanning via ServiceScan source generator
// Decorate your partial class and all matching services are registered at compile time
[RegisterServices]
public partial class ServiceRegistrar;

// 3. FluentValidation DI integration
builder.Services.AddValidatorsFromAssemblyContaining<Program>();

// 4. Resilient HTTP client with HttpClientFactory + Polly
builder.Services.AddHttpClient<IPaymentApi>(client =>
    client.BaseAddress = new Uri(builder.Configuration["PaymentApi:BaseUrl"]!))
    .AddStandardResilienceHandler();

Included Packages

Package Version
MediatR 12.5.0
ServiceScan.SourceGenerator 2.4.1
FluentValidation.DependencyInjectionExtensions 12.1.1
Microsoft.Extensions.Http 10.0.3
Microsoft.Extensions.Http.Resilience 10.3.0

License

Apache-2.0

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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 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

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
4.0.0 149 4/8/2026
3.0.3 176 3/20/2026
2.0.1 195 2/23/2026
2.0.0 199 2/23/2026