Errors with TextMeshPro

I am getting errors when using TextMeshPro in the editor. I have had the same issue with Unity UI. The errors are only seen in the editor, but are extremally annoying.

I have attached an image viewing the code and my extensions (if that helps). I have also tried regenerating the csproj files already, restarting unity, re-installing unity, checking if another project works, re-installing VS Code, restarting my computer, trying the issue to see if this works on Unity 2021, and re-installing my extensions.

I would appreciate any help.

Thanks in advance.

Hi Flash,

Are there any messages in the console of VS Code?

The type or namespace name ‘TMPro’ could not be found (are you missing a using directive or an assembly reference?)
The type or namespace name ‘TextMeshPro’ could not be found (are you missing a using directive or an assembly reference?)

Is the TextMeshPro package installed in Unity (Window > Package Manager)?

Yep, already installed.

In that case, try to regenerate the project files in in Unity (Edit > Preferences > External Tools).

I have already done this.

Install and use Visual Studio (Community Edition). For some students, VS Code simply does not work well. Maybe due to a problem with Unity, some update or whatever.

  1. Install VS.
  2. Select it as your External Script Editor in Unity (Edit > Preferences > External Tools).
  3. Install the “Visual Studio Editor” package in the Package Manager.

That should hopefully work.

Now nothing with intellisense is working at all. It seems silly to just swap script editors every time I have an issue with them. I did switched to VS Code so that intellisense worked in the first place.

Is there some other way of keeping VS Code?

It seems silly to just swap script editors every time I have an issue with them.

I agree with you.

Have you already tried something like this?

Or this?


I did switched to VS Code so that intellisense worked in the first place.

From my experience, fixing issues in VS is way easier. Usually, closing Unity and VS, then deleting the sln and csproj files in the Project folder fixes the issue with IntelliSense. Of course, the Unity game development workload must be installed in VS.

Privacy & Terms