Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Renamed Script, now the external editor is missing namespaces

Discussion in 'Editor & General Support' started by danield, Feb 3, 2020.

  1. danield

    danield

    Joined:
    Sep 30, 2014
    Posts:
    40
    Hello,
    I renamed a script from GameManager to GameController and I renamed the class too. I expected to be fixing the few references I had to the script, but something else happened too. The UnityEditor has no problems shown and in-editor play works like it was before the renaming. However, VSCode now shows these errors on some other scripts.
    I did some digging and I guess it has to do with Assembly-CSharp.dll and maybe creating a AssemblyDefenition would fix the problem. So I tried that to no avail.
    I'm guessing my inexperience with the more technical stuff, or the fact that I do not see those namespaces in the Scripting Documentation for Unity 2019.3.0f6 might have something do with it. It just seems odd that prior to renaming that one file, I was getting no errors in VSCode.

    Any advice on fixing the problem would be appreciated. :)
     
  2. danield

    danield

    Joined:
    Sep 30, 2014
    Posts:
    40
    Update
    After further investigation, I think my issue may have been a delayed bug.
    https://issuetracker.unity3d.com/is...in-vscode-console-when-using-vscode-1-dot-1-4
    Because VSCode has this in the output.
    I'm not sure what is meant by downgrading the Visual Studio Code Editor package to 1.1.3, so if anybody can explain, I would be grateful.
     
  3. ColinBellino

    ColinBellino

    Joined:
    Mar 1, 2015
    Posts:
    4
    You can change the version of the "Visual Studio Code Editor" in the Package Manager window ("Window" > "Packages Manager"). Here you should see a list packages already installed for your project. If you click on "Visual Studio Code Editor" and click the expand arrow on the left (see screenshot below), you should see the "See all versions" button. Click it and select the version you want to install and then "Update to x.x.x" in the bottom right corner of the window.

    Hope this helps !

    upload_2020-2-4_21-18-58.png
     
  4. gatzkerob

    gatzkerob

    Joined:
    Jan 19, 2020
    Posts:
    5
    I tried this but still getting same error. I did two things this morning: Upgraded Unity to 2019.3.0f6 and installed (then removed) TextMeshPro package. Not sure which one is causing the new UnityEngine.UI errors.
     
  5. danield

    danield

    Joined:
    Sep 30, 2014
    Posts:
    40
    I have had success :D
    I do still wonder if the UnityEngine.UI is being replaced by UIElements.
    @ gatzkerob: You might need to delete the *.csproj file and the Temp folder in your project and reopen unity.