"type or namespace not found" but the script is global

I’m getting the following error

error CS0246: The type or namespace name ‘MainControls’ could not be found (are you missing a using directive or an assembly reference?)

However, MainControls is in Assembly-CSharp.dll and has no namespace so I’m very confused. It can’t be found by any of my scripts that are in their own assemblies, only others that share the global assembly.

Any help is appreciated.

I don't think the filename that is shown there (Assembly-CSahrp.dll) is the actual name of the file. When I click on any script in my project, the inspector shows the same filename (Assembly-CSahrp.dll), even though it is a .cs file. Make sure the MainControls class is not inside an Editor folder. Can you even find the file that has the MainControls class?

–

Assembly-CSahrp.dll is the assembly definition, not the file name/class name. It's the default assembly for a Unity project. I believed that it was referenced by all other assemblies by default but it seems I was mistaken. I think that's where the issue lies.

–