Visual Studio - The type or namespace could not be found

Hi guys,

I have just installed Unity 2019.3.12f1 with Visual Studio Community 2019. I’ve installed a package and I’m trying to get it to work. However, within Visual Studio, it can not find certain classes (see attached image). When hovering over it says:

“The type or namespace ‘GridTile’ could not be found (are you missing a directive or assembly reference?)”

The RoomGenerator class is not namespaced, and the GridTile/GridObject classes are within a different project within the same solution (see right sidebar in image).

How do I get the Assembly-CSharp project to pick up the classes from the other solution projects? Am I missing a setting?

When I run the game everything works, so I feel like it’s an Intellisense issue maybe?

Cheers,
Rutger

Did you put the module name inside the asmdef file?

For example, I have two modules, named as MockOne and MockTwo.

This is not the namespace name, but we usually keep them have the same name.
If you want to use some classes or namespaces from MockTwo inside MockOne, you need to add such thing under the MockOne’s .asmdef file, then the MockOne.asmdef may look like:

{
    "name":"MockOne"
    "references": [
        "MockTwo"
    ]
}

Hope this may help you.