Using UnityEngine.UI; errors

I am on Section 3.21 of Complete C# Unity Developer 2D: Learn to Code Making Games and i have seen the video 2.16 and did it step by step to try fix the proplem . Looks like the library UnityEngine.UI cant be found. How can i fix it? using latest Unity 2019.2.11f1. Or should i just download 2018.1 to follow the sections?

Hi,

Downgrading is not necessary. Could you please upload your code to pastebin.com and share a link here? Also, as an exception, post a screenshot of your code.

https://pastebin.com/Fr69HWSB

Screenshot_1

2019.2.11f1 is screaming hot (only a few days old) so you may need to check for updates with the Unity Tools for Visual Studio (within the installed features of your Visual Studio) to see if it is in need of an update as well. It might be found in an installation category called “Game development with Unity”.

See here: https://docs.microsoft.com/en-us/visualstudio/cross-platform/getting-started-with-visual-studio-tools-for-unity?view=vs-2019

Also what version/edition of Visual Studio are you using?

I would also check which target framework VS thinks it should be using for your project in case it’s picking an older / legacy one. There’s some information to go through and check if all is well with that here: https://docs.microsoft.com/en-us/visualstudio/cross-platform/using-visual-studio-tools-for-unity?view=vs-2019

I am using visual studio community 2017 i checked yours links still cant figure out how to fix this.
I tried downgrading the unity and ended up working the library but i get new errors about

You’ve gone from losing the reference from UnityEngine.UI (and things like Text components), to getting that back and losing the reference from UnityEngine itself with Monobehaviors.

This really looks like an issue with a misinstalled or incompatible version of the Unity Tools for Visual Studio, but aside from going into the VS Installer options to uninstall / reinstall that, I’m not sure what else to suggest currently.

I also use VS 2017 community, just for comparison, although I believe the last version of Unity I used with that was 2019.2.1f1 - all the later updates I’ve been using with Rider instead now, but back when I used VS it was quite normal for this kind of disconnect to occur as soon as a new release of Unity came out and the Tools piece that’s installed direct into VS (and/or Resharper in my case) hadn’t caught up yet.

I read all your tips. Looks like i guess… i found the problem. I reinstalled everything and while doing it i found out i had downloaded VS 2017 and VS 2019 well i just installed 2017. Also created new project and did it again. Looks like working totally fine now somehow… Thanks a lot for your help.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms