Skip to content
LatchkeyLatchkey home

C# "CS0535: does not implement interface member" in CI

CS0535 means a type declares an interface but does not provide one of its members. In CI this commonly surfaces after a package or shared contract added a new interface method that the implementing class has not caught up to yet.

What this error means

The build fails with CS0535 naming the type, the interface, and the unimplemented member. It is deterministic for the restored interface version.

dotnet
Repos/UserRepo.cs(6,14): error CS0535: 'UserRepo' does not implement interface member
'IUserRepo.GetByEmailAsync(string)'

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

Common causes

The interface gained a member the class lacks

An upstream interface added a method (or the signature changed) and the implementing class was not updated, leaving the contract unsatisfied.

A signature mismatch

The class has a member with a slightly different signature (return type, parameter list, async), so it does not satisfy the interface member.

How to fix it

Implement the member exactly

  1. Copy the interface member signature and add the missing implementation.
  2. Match the return type and parameters precisely, including async and nullability.
  3. Consider a default interface implementation upstream if many implementers are affected, then rebuild.

How to prevent it

  • Pin shared-contract packages so interface surfaces do not shift mid-stream.
  • Treat interface changes as breaking and update all implementers in the same change.

Frequently asked questions

What causes C# "CS0535: does not implement interface member" in CI?
There are 2 common causes: the interface gained a member the class lacks and a signature mismatch. An upstream interface added a method (or the signature changed) and the implementing class was not updated, leaving the contract unsatisfied.
How do I fix C# "CS0535: does not implement interface member" in CI?
Implement the member exactly. Copy the interface member signature and add the missing implementation.
What does C# "CS0535: does not implement interface member" in CI actually mean?
The build fails with CS0535 naming the type, the interface, and the unimplemented member.
How do I stop C# "CS0535: does not implement interface member" in CI happening again?
Pin shared-contract packages so interface surfaces do not shift mid-stream. The prevention section lists 2 changes that keep it from recurring.

Related guides

References

Not every red build is your code. Latchkey repairs the ones that are not, on the runner. Start free → 30-day trial · No credit card