Scrutinator 2.0.0
dotnet add package Scrutinator --version 2.0.0
NuGet\Install-Package Scrutinator -Version 2.0.0
<PackageReference Include="Scrutinator" Version="2.0.0" />
<PackageVersion Include="Scrutinator" Version="2.0.0" />
<PackageReference Include="Scrutinator" />
paket add Scrutinator --version 2.0.0
#r "nuget: Scrutinator, 2.0.0"
#:package Scrutinator@2.0.0
#addin nuget:?package=Scrutinator&version=2.0.0
#tool nuget:?package=Scrutinator&version=2.0.0
Scrutinator
Scrutinator is a lightweight diagnostic tool for inspecting ASP.NET Core dependency injection containers. It captures your IServiceCollection, analyzes registrations, and serves a small dashboard that lists services, lifetimes, and potential captive dependency issues.
And now with a fancy Log Scrutinating Dashboard.
Features
- Lists all registered services with their implementation types, lifetimes, and namespaces.
- Filters by lifetime and text search in the embedded dashboard.
- Optional captive dependency warnings (singleton depending on scoped services).
- Hides Microsoft/System services by default to reduce noise.
- Optional auto-open of the dashboard on app start.
Quick start
Install the package:
dotnet add package Scrutinator
Wire it up in your application:
using Scrutinator.Middleware;
var builder = WebApplication.CreateBuilder(args);
builder.Services
.AddScrutinatorDI()
.AddScrutinatorLog();
// Or, if you have a custom log, like a ILog
.AddScrutinatorCustomLogger<ILog>();
var app = builder.Build();
app
.UseScrutinatorDI()
.UseScrutinatorLog();
app.Run();
For DI:
Open the dashboard at http(s)://<host>/di-scrutinator.
For Logs:
Open the dashboard at http(s)://<host>/log-scrutinator.
Configuration
Configure options when adding the middleware:
app.UseScrutinatorDI(options =>
{
options.IncludeSystemServices = false;
options.ScanForCaptiveDependencies = true;
options.OpenDashboardAutomatically = true;
});
app.UseScrutinatorLog(options =>
{
options.OpenDashboardAutomatically = true;
});
app.UseScrutinatorPackage(opts =>
{
opts.OpenDashboardAutomatically = true;
});
Options:
IncludeSystemServices(default: false): includeSystem.*andMicrosoft.*registrations.ScanForCaptiveDependencies(default: true): scan singleton constructors for scoped dependencies.OpenDashboardAutomatically(default: true): open the dashboard in the default browser on app start.
How it works
DI - Scrutinator
Scrutinator captures the IServiceCollection via AddDIScrutinator(), then analyzes it when the dashboard route is hit. The UI is an embedded HTML file that renders the serialized report.
Captive dependency analysis is best-effort and only runs when a singleton has a concrete ImplementationType. Registrations based on factories or instances cannot be fully inspected.
Log - Scrutinator
Scrutinator captures logs from the ILogger provider and analyzes them when the dashboard route is hit.
Package - Scrutinator
Scrutinator captures the packages from the Assembly and analyzes it when the dashboard route is hit.
Development
The project's repo includes a Sandbox project that demonstrates usage:
dotnet run --project Sandbox
dotnet build --configuration Release
dotnet pack --configuration Release
Then navigate to https://localhost:<port>/di-scrutinator or https://localhost:<port>/log-scrutinator or https://localhost:<port>/package-scrutinator in your browser.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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. |
-
net8.0
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.