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

Assembly references not working

Discussion in 'Editor & General Support' started by StaffanLangin, Jan 20, 2021.

  1. StaffanLangin

    StaffanLangin

    Joined:
    Jan 17, 2019
    Posts:
    4
    After upgrading to 2020.2.0f1 and 2020.2.1f1 references to the assemblies in our project doesn't work when compiled in VS2019. For instance, we're using NavMeshComponents and the NavMeshComponents assembly compiles fine but the NavMeshComponentsEditor assembly, which references NavMeshComponents doesn't due to the classes in the NavMeshComponents assembly not being visible to the classes in the NavMeshComponentsEditor assembly. The NavMeshComponentsEditor assembly does contain a reference to the NavMeshComponents assembly and when I look at the NavMeshComponents assembly in ObjectBrowser the namespace and corresponding classes shows up as expected. 2019.4.18f1 doesn't exhibit this problem. Is there a fix to this issue?

    Best regards,
    Staffan
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,762
    First get your project under source control if it isn't already.

    Then try reimport all to trigger a full recompile.

    If that doesn't work, try update all your packages, particularly the navmesh stuff and perhaps the Visual studio integration stuff.

    This may help you with intellisense problems:

    https://forum.unity.com/threads/intellisense-not-working-with-visual-studio-fix.836599/

    Also, try update the VSCode package inside of Unity: Window -> Package Manager -> Search for Visual Studio Code Editor -> Press the Update button

    Also, this: https://forum.unity.com/threads/no-suggestions-in-vscode.955197/#post-6227874
     
  3. StaffanLangin

    StaffanLangin

    Joined:
    Jan 17, 2019
    Posts:
    4
    Hi there Kurt-Dekker,

    Thanks for your reply. I should have mentioned that I've upgraded to NavMeshComponents-2020.2 and to the latest version of all the packages I'm using. Also, the problem is that the compiler isn't able to see/locate the namespace and classes in the referenced assemblies. Hence, I get compile errors, so this issue isn't really about the VS editor/intellisense not being able to see/locate the referenced assemblies (even though they don't either), but about something more severe as the compiler isn't able to see the referenced assemblies.

    Best regards,
    Staffan
     
  4. spryx

    spryx

    Joined:
    Jul 23, 2013
    Posts:
    556
    Try regenerating your project files. I have to do this everytime I upgrade.
     
  5. StaffanLangin

    StaffanLangin

    Joined:
    Jan 17, 2019
    Posts:
    4
    Hi there Spryx,

    By regenerate my project files, do you mean to reimport my assets (Assets/Reimport or Assets/Reimport All)? I've tried that several times as well as manually deleting the generated cs project-files and letting Unity re-generate them to no avail. I've tried this with both 2020.2.0f1 and 2020.2.1f1 btw.

    Best regards,
    Staffan
     
  6. spryx

    spryx

    Joined:
    Jul 23, 2013
    Posts:
    556
    No. I believe under project preferences there is a button to regenerate .csproj files. This is the one you want.
     
  7. StaffanLangin

    StaffanLangin

    Joined:
    Jan 17, 2019
    Posts:
    4
    Spryx,

    Thanks for the info. I found the setting. Unfortunately, it didn't help. It seems I have no other choice than reverting to 2019.4 and hope this issue will be fixed in an upcoming release.

    Best regards,
    Staffan
     
  8. spryx

    spryx

    Joined:
    Jul 23, 2013
    Posts:
    556
    Sorry, sounds frustrating. That's super odd. Are you sure they didn't change namespaces on something? (they've been known to do that from time to time). I'm out of ideas. Hope you are able to fix it.
     
  9. Din0m1te

    Din0m1te

    Joined:
    Sep 9, 2015
    Posts:
    31
    I am having the same issue with 2020.2.5f1. Everythign works fine in 2019.4 but as soon as I upgrade assembly references are somehow broken.
     
  10. konsnos

    konsnos

    Joined:
    Feb 13, 2012
    Posts:
    120
    I'm having the same issue with 2020.2.3f1 but with just one out of two of my projects. I've tried comparing them but settings-wise they are the same.
     
  11. sergmolot

    sergmolot

    Joined:
    Nov 21, 2016
    Posts:
    9
    I have the same problem after switching from 2020.3 to 2022.
     
  12. Burn0815

    Burn0815

    Joined:
    Jul 3, 2019
    Posts:
    10
    Assembly References in my project could not be resolved in VisualStudio (Unity 2020.3.8, VS Studio for Mac 17.3.7).
    btw - I had no compile errors in Unity.

    that solution worked for me:
    I have closed Visual Studio and then manually deleted all *.csproj and *.sln files in my project root directory. after launching VS again, all csproj and sln files where created again - and it worked. all references could be resolved in VS again ;)