Soenneker.StartupFilters.IntegrationTests
4.0.121
Prefix Reserved
dotnet add package Soenneker.StartupFilters.IntegrationTests --version 4.0.121
NuGet\Install-Package Soenneker.StartupFilters.IntegrationTests -Version 4.0.121
<PackageReference Include="Soenneker.StartupFilters.IntegrationTests" Version="4.0.121" />
<PackageVersion Include="Soenneker.StartupFilters.IntegrationTests" Version="4.0.121" />
<PackageReference Include="Soenneker.StartupFilters.IntegrationTests" />
paket add Soenneker.StartupFilters.IntegrationTests --version 4.0.121
#r "nuget: Soenneker.StartupFilters.IntegrationTests, 4.0.121"
#:package Soenneker.StartupFilters.IntegrationTests@4.0.121
#addin nuget:?package=Soenneker.StartupFilters.IntegrationTests&version=4.0.121
#tool nuget:?package=Soenneker.StartupFilters.IntegrationTests&version=4.0.121
Soenneker.StartupFilters.IntegrationTests
An ASP.NET Core startup filter that makes in-memory integration-test requests appear to originate from the loopback address.
Installation
dotnet add package Soenneker.StartupFilters.IntegrationTests
Usage with WebApplicationFactory
using Microsoft.AspNetCore.Mvc.Testing;
using Soenneker.StartupFilters.IntegrationTests.Registrars;
await using var factory = new WebApplicationFactory<Program>()
.WithWebHostBuilder(builder =>
{
builder.ConfigureServices(services =>
{
services.AddIntegrationTestsStartupFilterAsSingleton();
});
});
using HttpClient client = factory.CreateClient();
HttpResponseMessage response = await client.GetAsync("/health");
The filter inserts LocalIpAddressMiddleware before the application's configured pipeline. For every request, that middleware sets both HttpContext.Connection.LocalIpAddress and RemoteIpAddress to IPAddress.Loopback. This is useful when code under test requires connection-address data that an in-memory test server does not provide.
Test-only safety
Do not register this package in production. Replacing RemoteIpAddress can bypass application behavior that trusts loopback traffic, including IP allowlists or local-only endpoints. Keep the registration inside the integration-test host configuration rather than shared application startup.
The singleton registration is the normal choice because startup filters are consumed while the host builds its middleware pipeline. The scoped registrar is available for specialized hosts, but it is not needed for a standard WebApplicationFactory setup.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net10.0
- Microsoft.AspNetCore.Hosting.Abstractions (>= 2.3.12)
- Soenneker.Middlewares.LocalIpAddress (>= 4.0.68)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Soenneker.StartupFilters.IntegrationTests:
| Package | Downloads |
|---|---|
|
Soenneker.Fixtures.Integration
Provides a reusable and generic integration test xunit fixture that dynamically registers and configures WebApplicationFactory instances for multiple ASP.NET Core projects with support for custom app settings, authentication, logging, and test utilities. |
|
|
Soenneker.TestHosts.Integration
Provides a reusable and generic integration test host that dynamically registers and configures WebApplicationFactory instances for multiple ASP.NET Core projects with support for custom app settings, authentication, logging, and test utilities. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.121 | 50 | 8/30/2026 |
| 4.0.120 | 30 | 8/30/2026 |
| 4.0.119 | 148 | 8/30/2026 |
| 4.0.118 | 87 | 8/29/2026 |
| 4.0.117 | 37 | 8/29/2026 |
| 4.0.116 | 39 | 8/29/2026 |
| 4.0.115 | 1,051 | 8/11/2026 |
| 4.0.114 | 738 | 7/28/2026 |
| 4.0.113 | 182 | 7/27/2026 |
| 4.0.112 | 833 | 7/16/2026 |
| 4.0.111 | 107 | 7/16/2026 |
| 4.0.110 | 1,450 | 6/19/2026 |
| 4.0.109 | 148 | 6/18/2026 |
| 4.0.108 | 780 | 6/9/2026 |
| 4.0.107 | 666 | 6/5/2026 |
| 4.0.106 | 126 | 6/5/2026 |
| 4.0.104 | 922 | 5/12/2026 |
| 4.0.102 | 2,085 | 3/12/2026 |
| 4.0.101 | 124 | 3/12/2026 |
| 4.0.98 | 140 | 3/12/2026 |
Update dependency Soenneker.Middlewares.LocalIpAddress to 4.0.68 (#659)