Skip to main content
Xunit.DependencyInjection package icon

Xunit.DependencyInjection

Use Microsoft.Extensions.DependencyInjection to inject xunit testclass. If you want write Microsoft.Extensions.Logging to ITestOutputHelper, please install Xunit.DependencyInjection.Logging. Release notes: 10.8: Add CreateHostApplicationBuilder method. 10.7: Update xunit.v3 to 3.0.1, does not set ApplicationName if it is already configured. 10.6: Update xunit.v3 to 3.0.0. 10.5: Improve compatibility with top level statements. 10.4: Fix #146. 10.3: Update xunit.v3 to 2.0.0. 10.2: Fix some parallelization problem. 10.1: Allow the default startup to be missing anywhere. 10.0: Upgrade xunit to v3.

Total Downloads
22.3M
22,324,896
Published
Sep 21, 2025
Latest stable version

Install

.NET CLI
dotnet add package Xunit.DependencyInjection --version 10.8.0
Package Manager Console
Install-Package Xunit.DependencyInjection -Version 10.8.0
PackageReference
<PackageReference Include="Xunit.DependencyInjection" Version="10.8.0" />

Frameworks

.NETFramework4.7.2 .NETStandard2.1

Dependencies

[9.0.0, )
[3.0.1, )
[9.0.0, )
[3.0.1, )

Adoption guide

Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.

Compatibility metadata lists 2 target frameworks; confirm the exact target used by your application.

How to read this guidance

Sources: published NuGet v3 registry metadata and explicit NuBrowse editorial guides. Refresh: package metadata is refreshed from NuGet when the page loads. Limit: this is not a security, legal or compatibility guarantee; validate the selected version in your project.

Useful next steps

Move from package metadata to a concrete selection or review workflow.