- Home /
2019.3, UnityEngine.UI, and VS Code?
Looking through the recent 2019.3 release, there doesn't seem to be a UnityEngine.UI
namespace being seen by Microsoft's C# plugin for Visual Studio Code. The namespace is still valid on the Unity side and projects compile just fine, but anything referencing those UI classes / functions will give your project a sea of red squiggles / filenames.
I assumed it was just a weird behavior from migrating a 2019.2 project to 2019.3, but even brand new projects seem to give this behavior. Did anyone have a similar problem and find a solution?
Thanks!
I'm also experiencing the exact issue after upgrading to 2019.3. Nothing seems to be affected in Unity, but VS is not recognizing the namespace, and it's making me uncomfortable with the state of certain classes, since it'll probably make tracking newer errors more difficult. Have any of the solutions from the other commentors worked for you as of yet?
Not so far, I'll sit down with it after work and try to work something out. Hoping someone had a trivial fix and enlightens us after seeing this thread.
Answer by RahulRaman · Feb 03, 2020 at 04:51 PM
Which version of the vs code plugin you use in package manager? If you are using 1.1.4 try downgrading the version and the error will probably fix.
This worked, so to resolve:
1] In Unity, go to Window/Package $$anonymous$$anager
2] Search for your Visual Studio Code Editor package
3] Downgrade to version 1.1.3
4] Close Unity
5] Delete your .csproj and .sln files in your project
6] Open Unity
That fixed it for me, can get back to work.
There's an active issue tracker post about this also: https://issuetracker.unity3d.com/issues/vscode-omnisharp-project-reference-warnings-are-thrown-in-vscode-console-when-using-vscode-1-dot-1-4
Just a heads up that this method ALSO fixed the exact same issue I had with the T$$anonymous$$Pro namespace
Thanks for sharing, that is exactly what I needed to fix my problem. Woot!
answer from @RahulRaman is worked for me.
Thanks a lot man.
This also kinda worked for me but I wanted to use the updated code editor package (cause you know wat might happens in the future):
Update to Visual Studio Code Editor package 1.2.0
Delete the old csproj files in your project
Regenerate new csproj files from Unity in Preferences > External Tools (just the embbeded ones for me)
Thanks for pointing me in the right direction!
As of $$anonymous$$arch 12 2020, you can just upgrade the package to 1.2.0. The devs fixed this weird problem.
Answer by Babaloon · Feb 21, 2020 at 09:38 AM
I've the same issue ... I downgraded, reinstalled plugin and VS, changed Unity version, deleted csproj and sln, reimported assets, restart the computer but I still got the issue...,Yeah same for me with 2019.3.0f6... I downgraded, resintalled VS, reinstall plugin, delete csproj et sln but I've still this error ...
Answer by SaveZeQueen · Nov 16, 2021 at 03:42 PM
I was having trouble getting my info to work, I tried pretty much everything that every google search recommended.
Though none of it worked except for the following:
1. I uncheck all the .csproj boxes under Edit > Preferences
2. Then Regenerate Project Files
I hope this is able to help those of you that had a similar struggle like myself.
Astoundingly, this worked. Unchecked "Built-in packages" and it started working.
This is the actual correct answer and is the one that Unity recommends. It works for every version of Unity (not just 2019) and every version of VS Code. There is no need to delete files or downgrade anything.
Answer by demalpica · May 01, 2020 at 09:50 PM
I'm seeing this on 2019.3.12, vs code [March 2020] and vs code package 1.1.4.
Upgrading to vs code editor package v 1.2.0 also revolved the issue for me.
may i ask how to upgrade vs code editor package to v.1.2.0 ? from Unity Package $$anonymous$$anager ? i can only find 'Visual Studio Code Editor' v.1.1.4 installed with my Unity3D 2019.2.15f1. because i am in 2019.2 of Unity3D? how can i find the v1.2.0 version ? thanks
Perhaps it is the version of Unity. I can't really say.
On the package manager it is straight forward how to find the new version.
Answer by ohellno · Feb 19, 2020 at 03:04 AM
This happened to me as well, going to package manager and "updating" to version 1.13 worked for me, but definitely is quite annoying doing this every time you create a new project.
Updating Visual Studio Code removed this error for me when creating new projects.
So try updating your version of VS @TreyH
Your answer
Follow this Question
Related Questions
Unity 8.1 How to get text via script 0 Answers
Is there a reason why Unity would be able to read one variable in a script and not another? 1 Answer
Why isn't my instance of an object moving? 1 Answer
Left side panel in monodevelop 1 Answer
Why don't I get access to current context with wglGetCurrentContext (OpenGL) 1 Answer