Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Unity 2020 LTS & Unity 2021.1 have been released.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

missing UnityEngine.UI

Discussion in 'Editor & General Support' started by dedefac96, Aug 28, 2019.

  1. dedefac96

    dedefac96

    Joined:
    Sep 18, 2018
    Posts:
    12
    Hello,
    i have a visual studio code project in c#. This project is used in all my unity projects (i set them the .dll).
    This VSC project needs UnityEngine.dll, UnityEngine.UI.dll that i took from unity 2018. Now i want to updgrade my vsc project with unity 2019.2.2f1 but UnityEngine.UI.dll doesn't exist anymore, how can i do ? i tried to keep the old UnityEngine.UI.dll in my vsc project, which i could successfully generate the dll but when i insert my vsc dll in my unity project with unity 2019.2.2, i get an error which say that i can't use UnityEngine.UI in my vsc project.

    I have see about the asmdef but this is not a file i can include in my vsc project isn't it ?

    Thank you.
     
  2. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    9,765
    Starting in Unity 2019.2, the UI component has been moved into Package Manager. Not sure if that helps to answer your question though.
     
    nikolay_i and Stizeeven like this.
  3. Vectorbox

    Vectorbox

    Joined:
    Jan 27, 2014
    Posts:
    210
    I also have VS library projects which require a Unity UI reference. Surely this situation was considered before making the decision ?.
     
  4. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    2,559
    UnityEngine.UI.dll still exists, but it comes from package, check Packages\manifest.json, you should have an entry

    "com.unity.modules.ui": "1.0.0",

    Assuming you keep your VS project at the root of Unity project, the reference is done like this

    <Reference Include="UnityEngine.UI">
    <HintPath>Library/ScriptAssemblies/UnityEngine.UI.dll</HintPath>
    </Reference>
     
  5. Vectorbox

    Vectorbox

    Joined:
    Jan 27, 2014
    Posts:
    210
    Thanks Tomas, I'll check it out.
     
  6. selkeer

    selkeer

    Joined:
    Sep 20, 2017
    Posts:
    7
    Thank you for your help. My vsc project is build in its own directory then a dll is created that I put in my unity project so I can't get the Unityengine.ui.dll this way. I tried to just set the unityengine.ui.dll of an empty unity project in my vsc project but I have error which tell me that the ui dll need others dependancies. Im currently trying to set them in the csproj
     
  7. Vectorbox

    Vectorbox

    Joined:
    Jan 27, 2014
    Posts:
    210
    This is my preferred method too, so it seems I'd have to adapt to the new system. As my existing libraries will be incompatible, I might just stick with version 2018.
     
    VoodooAssets likes this.
  8. MaxUnity111

    MaxUnity111

    Joined:
    Mar 25, 2019
    Posts:
    11
    Hi, I’m doing this recently. You can read more about where and how


    <Reference Include="UnityEngine.UI">
    <HintPath>Library/ScriptAssemblies/UnityEngine.UI.dll</HintPath>
    </Reference>[/QUOTE]
     
  9. Bmco

    Bmco

    Joined:
    Mar 11, 2020
    Posts:
    4
    I just figured out the problem for me (this is a repost from a similar thread, hopefully it helps)…

    I was separating my project into different assemblies (creating a .asmdef file) and suddenly lost all my UnityEngine.UI references...

    Currently using 2019.3.0a3.

    If you look through the Packages folder there is : Packages\Unity UI\Runtime\Unity.ugui.asmdef

    I was looking for UnityEngine.UI and it wasn't there. However, if you add a reference to Unity.ugui in the references section of your .asmdef file, then in your scripts, the code "using UnityEngine.UI" works!
     
  10. zdlzyw_unity

    zdlzyw_unity

    Joined:
    Dec 25, 2018
    Posts:
    1
    just close vscode, remove visual studio code editor from window - package manager , then reinstall ,ver1.2.0+
     
  11. Imperial-Dynamics

    Imperial-Dynamics

    Joined:
    Oct 18, 2019
    Posts:
    13
    Easy solution that works 100%:

    go to Edit > Preferences > External Tools make sure the 'Generate all .csproj files.' is checked

    close Unity
    delete all csproj and sln files in your folder
    open Unity
     
  12. MaxIzrinCubeUX

    MaxIzrinCubeUX

    Joined:
    Jan 13, 2020
    Posts:
    5
    This fixed it for me:
    https://stackoverflow.com/a/60763699/3249250

    Add the following reference to UnityEngine.UI in the "Assembly-CSharp.cproj" at the root of the project.

    <Reference Include="UnityEngine.UI">
    <HintPath>Library/ScriptAssemblies/UnityEngine.UI.dll</HintPath>
    </Reference>
     
    Lotramus likes this.
  13. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    1,215
    Most of the recent answers are for a differnet problem, which really doesn't help.

    Right now the problem still appears to exist: Unity has messed-up the packaging of the UnityEngine.UI.dll for years, and it's simply not possible to create DLL's of anything that references UI.EventSystems - because they're missing.

    I've just spent the last couple of hours trying to find a working version of that DLL (Unity broke it sometime in 2018.x / 2019.x) and use it to continue building DLLs, but I'm going round in circles. This has worked for me before, and all other references (many different Unity modules, including UI, including IMGUI, including Physics, etc) are all working - but the EventSystems is just missing from everything.

    Is this still broken? Is EventSystems still gone from the UnityEditor, with no replacement?
     
unityunity