# WebApplicationFactory "The following constructor parameters did not have matching fixture data" in CI

> Fix xUnit "The following constructor parameters did not have matching fixture data" with WebApplicationFactory in CI - the test class fixture is not wired up correctly.

Source: https://latchkey.dev/learn/dotnet/aspnet-webapplicationfactory-constructor-parameters-in-ci  
Updated: 2026-06-30

xUnit could not supply a constructor parameter of your integration test because the class does not implement `IClassFixture<T>` for that type, or the factory type does not match. Wire the fixture so xUnit injects the WebApplicationFactory.

## Diagnose it: SDK version and restore first

Most .NET CI failures are an SDK mismatch or a restore that did not happen. `global.json` pins the SDK, and if the runner does not have that exact version the failure message is about the project rather than the SDK.

```Terminal
dotnet --info
cat global.json 2>/dev/null

# restore explicitly so a restore failure is not reported as a build failure
dotnet restore --verbosity normal
dotnet build --no-restore -warnaserror
```

> Pin the SDK with `global.json` and install exactly that version with `actions/setup-dotnet`. A floating SDK turns a runner image update into a build break on unchanged code.

## FAQ

### What causes WebApplicationFactory "The following constructor parameters did not have matching fixture data" in CI?

There are 2 common causes: the test class does not implement iclassfixture and the fixture type does not match the parameter. xUnit only injects a fixture the class declares via IClassFixture<T>; without it, the constructor parameter has no source.

### How do I fix WebApplicationFactory "The following constructor parameters did not have matching fixture data" in CI?

There are 2 fixes depending on which cause you have: implement iclassfixture with the exact type and expose program to the test project. Work through them in order, since the first is the most common.

### What does WebApplicationFactory "The following constructor parameters did not have matching fixture data" in CI actually mean?

Integration tests fail to run with "The following constructor parameters did not have matching fixture data: WebApplicationFactory<Program> factory" (or your custom factory type).

### How do I stop WebApplicationFactory "The following constructor parameters did not have matching fixture data" in CI happening again?

Match the IClassFixture type to the constructor parameter type. The prevention section lists 3 changes that keep it from recurring.

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
