Compilers doesn't recognize Unity.UI references
Hi,
I have since yesterday a really troubling mistake with compilers (VS and VS code) : they does'nt recognize references like UnityEngine.UI, EventSystems and TMPro. (CS0234 and CS0236) I have the same mistake on all my projects and tried to resolve it by all the potential solutions founded on the web. I use the latest version of Unity, compilers and packages. Can you help me to resolve this mistake please ?
Is Unity throwing the error or just VS / VS Code?
Have you imported the UI package from the package manager? Which version?
Have you imported the T$$anonymous$$Pro package from the package manager? Which version?
Can you provide your
manifest.json
in the Packages folder of your project?
Launch in Unity works perfectly, without any error. This is specific to the compilers.
I use Unity UI v 1.0.0 and T$$anonymous$$Pro 3.0.1 and there's my manifest.json :
"dependencies": {
"com.unity.collab-proxy": "1.3.9",
"com.unity.ide.rider": "1.2.1",
"com.unity.ide.visualstudio": "2.0.3",
"com.unity.ide.vscode": "1.2.2",
"com.unity.test-framework": "1.1.18",
"com.unity.textmeshpro": "3.0.1",
"com.unity.timeline": "1.3.6",
"com.unity.ugui": "1.0.0",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.androidjni": "1.0.0",
"com.unity.modules.animation": "1.0.0",
"com.unity.modules.assetbundle": "1.0.0",
"com.unity.modules.audio": "1.0.0",
"com.unity.modules.cloth": "1.0.0",
"com.unity.modules.director": "1.0.0",
"com.unity.modules.imageconversion": "1.0.0",
"com.unity.modules.imgui": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0",
"com.unity.modules.particlesystem": "1.0.0",
"com.unity.modules.physics": "1.0.0",
"com.unity.modules.physics2d": "1.0.0",
"com.unity.modules.screencapture": "1.0.0",
"com.unity.modules.terrain": "1.0.0",
"com.unity.modules.terrainphysics": "1.0.0",
"com.unity.modules.tilemap": "1.0.0",
"com.unity.modules.ui": "1.0.0",
"com.unity.modules.uielements": "1.0.0",
"com.unity.modules.umbra": "1.0.0",
"com.unity.modules.unityanalytics": "1.0.0",
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.modules.unitywebrequestassetbundle": "1.0.0",
"com.unity.modules.unitywebrequestaudio": "1.0.0",
"com.unity.modules.unitywebrequesttexture": "1.0.0",
"com.unity.modules.unitywebrequestwww": "1.0.0",
"com.unity.modules.vehicles": "1.0.0",
"com.unity.modules.video": "1.0.0",
"com.unity.modules.vr": "1.0.0",
"com.unity.modules.wind": "1.0.0",
"com.unity.modules.xr": "1.0.0"
}
Thanks for the answer :)
Can you:
Go into Edit > Preferences > External Tools
Ensure Visual Studio / VS Code is your external editor
Regenerate the project files using the button in the External Tools window
Close your project
Delete the Library (& Temp) folder(s), next to your Assets folder
Open Unity again
Uninstall & reinstall the packages again
I did (many times since yesterday) all you did, remove these packages : Unity UI, T$$anonymous$$Pro, VS and VS code for Unity.
I also deleted my library and temp files but the mistake doesn't seems to be about my project : every project have the same issue in compilers (include all new projects I have created for testing).
I reset all packages to default, nothing...
Finally I tried to remove all the versions of Unity and reinstall the last one, that didn't do anything...
If you just updated to a new version of Unity, you may just need to create a new script and open it Visual Studio.
That's what I did after updating Unity.
Finally I launched my project on VS another time and there are no errors. It seems to appears only on VS Code... I just abandoned this IDE for now.
Thanks for help
Your answer
![](https://koobas.hobune.stream/wayback/20220613014110im_/https://answers.unity.com/themes/thub/images/avi.jpg)