Home / Unity / U22

Unity error: CS1061: 'type' does not contain a definition for 'name' and no accessible extension method 'name' accepting a first argument of type 'type' could be found — cause and fix

The script calls a method, property, or field that does not exist on an instance of a type

ID
U22
Engine
Unity
Verification
官方文档引用
Frequency
未公开

Original message (verbatim)

CS1061: 'type' does not contain a definition for 'name' and no accessible extension method 'name' accepting a first argument of type 'type' could be found

Placeholders such as %s / %d are kept verbatim from the engine source and are not replaced with concrete values.

Trigger

The script calls a method, property, or field that does not exist on an instance of a type (misspelled member, the type inferred as a base class or interface, or a missing extension method reference), and compilation reports CS1061.

Typical cause

The compiler cannot find the member on the target type or among its accessible extension methods, so the call cannot be resolved.

Step-by-step fix

  1. Check the member spelling and confirm it exists on the target type.
  2. Verify the variable is typed as the concrete subclass or interface that exposes the member.
  3. Add the using directive for the namespace containing the extension method.

Source links

Per-entry sources and capture date are listed at /sources#U22.

Related errors

Related Unity errors

Need an offline quick-reference checklist?

Atlas error library Pro pack: 123 error references (110 single + 13 merged) plus a quick-fix guide, $19 one-time purchase, delivered as electronic files.

View Pro pack / order

Back to the all-errors index Checkout and buy the Pro pack — $19.00