C# "CS0117: type does not contain a definition for X" in CI
CS0117 fires when you reference a member (field, property, enum value, static method) directly on a type that does not declare it. The type resolved fine; the member name did not. In CI this most often means a package upgraded to a version where the member was renamed or removed.
What this error means
The build fails with CS0117 naming the type and the missing member. It is deterministic for a given set of restored package versions.
Models/Order.cs(22,30): error CS0117: 'OrderStatus' does not contain a definition for 'Pending'Common causes
A package upgrade renamed or removed the member
A floating version or a Directory.Packages.props bump pulled a release where the enum value or property was renamed, so the call site no longer compiles.
A typo or wrong overload target
The member name is misspelled, or the code targets a static member that is actually an instance member (or vice versa).
How to fix it
Match the call site to the current API
- Open the type definition for the restored version and confirm the real member name.
- Update the call site, or pin the package back to the version that still has the member.
- Rebuild.
How to prevent it
- Pin package versions so member surfaces do not shift unexpectedly between CI runs.
- Read release notes when bumping dependencies that you consume by member name.