Home / Unity / U23

Unity error: CS0234: The type or namespace name 'name' does not exist in the namespace 'namespace' (are you missing an assembly reference?) — cause and fix

The namespace or type referenced by the script does not exist in the current assembly (the

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

Original message (verbatim)

CS0234: The type or namespace name 'name' does not exist in the namespace 'namespace' (are you missing an assembly reference?)

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

Trigger

The namespace or type referenced by the script does not exist in the current assembly (the asmdef does not reference the assembly, the DLL is missing, the package is not installed, or the namespace is misspelled).

Typical cause

The compiler fails to resolve along the namespace hierarchy, and CS0234 points to a missing assembly reference or a spelling problem.

Step-by-step fix

  1. Verify the namespace and type spelling.
  2. Confirm the package or DLL is installed and referenced by the current asmdef.
  3. Check the assembly definition's references and compilation scope.

Source links

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

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