# C# "CS1061: no definition and no accessible extension method" (missing using) in CI

> Fix C# "CS1061: T does not contain a definition for M and no accessible extension method M accepting T could be found" in CI - an extension method whose namespace is not imported.

Source: https://latchkey.dev/learn/dotnet/dotnet-cs1061-extension-method-missing-using-in-ci  
Updated: 2026-06-26

This CS1061 variant is specifically about extension methods: the instance method does not exist on the type, and the extension that would supply it is not in scope because its namespace is not imported (commonly System.Linq or an EF Core extension namespace).

## 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 C# "CS1061: no definition and no accessible extension method" (missing using) in CI?

There are 2 common causes: the extension method namespace is not imported and the providing package is not referenced. LINQ (System.Linq), EF Core (Microsoft.EntityFrameworkCore), or another extension lives in a namespace the file does not using, so the method is invisible.

### How do I fix C# "CS1061: no definition and no accessible extension method" (missing using) in CI?

Import the namespace or add the package. Add the using for the extension namespace (e.g.

### What does C# "CS1061: no definition and no accessible extension method" (missing using) in CI actually mean?

The build fails with CS1061 mentioning "no accessible extension method ...

### How do I stop C# "CS1061: no definition and no accessible extension method" (missing using) in CI happening again?

Enable ImplicitUsings to bring System.Linq into scope by default. The prevention section lists 2 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
