Skip to main content
net10.0.NETFramework4.6.2net8.0net9.0

Experimental package. Tools for integration testing of apps built with Microsoft.Extensions.Hosting

Published
Oct 14, 2026
6d ago
Total Downloads
66.6K
66,585

Install

dotnet add package Microsoft.Extensions.Hosting.Testing --version 10.11.0-preview.1.26513.7
ProductVersions
.NET
net10.0net8.0net9.0
Other
.NETFramework4.6.2

README

Microsoft.Extensions.Hosting.Testing

Tools for integration testing of apps built with Microsoft.Extensions.Hosting.

Install the package

From the command-line:

dotnet add package Microsoft.Extensions.Hosting.Testing

Or directly in the C# project file:

<ItemGroup>
  <PackageReference Include="Microsoft.Extensions.Hosting.Testing" Version="[CURRENTVERSION]" />
</ItemGroup>

Usage Example

FakeHost

FakeHost enables creating an application host pre-configured for a unit test environment.

The host can be created using the following APIs:

public static IHostBuilder CreateBuilder()
public static IHostBuilder CreateBuilder(Action<FakeHostOptions> configure)
public static IHostBuilder CreateBuilder(FakeHostOptions options)

For example:

using var host = await FakeHost.CreateBuilder(options => { });
    .ConfigureServices(x =>
    {
        // ...
    })
    .StartAsync();

FakeHostingExtensions

FakeHostingExtensions is a collection of IHost and IHostBuilder extension methods for use within a unit test environment. These help collect logs as well as augment the host and app configurations.

Feedback & Contributing

For any feedback or contributions, please visit us in our GitHub repo.

Changes from Previous Version

No structural changes between v10.10.0-preview.1.26459.2 and v10.11.0-preview.1.26513.7.

Adoption Assessment

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

This version is marked prerelease. Validate its API and upgrade path before production use.Compatibility metadata lists 4 target frameworks; confirm the exact target used by your application.The published metadata declares 16 direct dependency entries across framework groups. Inspect the resolved dependency graph for your target framework.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.