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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Unity / Visual Studio Unexpected Behaviours

Discussion in 'Editor & General Support' started by lucernagame, Dec 21, 2018.

  1. lucernagame

    lucernagame

    Joined:
    Nov 5, 2018
    Posts:
    19
    I have one issue, or two issues, depending on perspective. First, WebGL isn't building and playing Vimeo videos from the Vimeo SDK in 2017.3, but some Vimeo SDK users are saying that it just doesn't work in that version, which I believe is the case.

    The main thing now, while upgrading a project in working order from 2017.3 to any newer version, it loses reference to the Vimeo namespace from the Vimeo SDK. When adding the reference back in inside Visual Studio, it causes all the "namespace not found" errors to go away, and it builds. When inside Unity, the "namespace not found" errors persist. If I save the scene, close, and reopen Unity, the errors come back inside Visual Studio automatically - it dereferenced the Vimeo namespace again, despite the cs files and csproj being in the same place.

    Is there a solution to this? I was not expecting this kind of behaviour.
     
  2. lucernagame

    lucernagame

    Joined:
    Nov 5, 2018
    Posts:
    19
    Can anyone tell me if this is a bug or not? I am not sure if I should file a bug report.
     
  3. lucernagame

    lucernagame

    Joined:
    Nov 5, 2018
    Posts:
    19
    I ended up solving the issue.

    I had everything inside /Assets/Scripts/Vimeo/Scripts, and it did not work when I moved the scripts folder up one level into into /Assets/Scripts/Scripts, nor when I reimported or renamed the folder to /Assets/Scripts/ASDF. On a whim I moved all of the files inside /Assets/Scripts/Scripts up a level right into /Assets/Scripts, which although makes the folder very messy as all the Vimeo SDK files and scripts are strewn about in there, Unity is now able to find all the namespaces.

    Also note that Visual Studio was able to find the files without issue and could even "Clean Solution" and "Build Solution" without any failures at all points here, it was just that Unity was never able to build without being able to find the namespaces until I moved everything up.
     
  4. unity_u_bj5XAIEcz9lQ

    unity_u_bj5XAIEcz9lQ

    Joined:
    Jun 20, 2020
    Posts:
    1
    Edit > Preference > External Tools.

    Pick Visual studio tick all packages (Embedded, local,registry... ) and regenerate project files. Now double click any script and vs should work with all intellisense and libs.
     
  5. W1zzel

    W1zzel

    Joined:
    Aug 7, 2017
    Posts:
    5
    really helpful, thanks
     
  6. pkoleszar

    pkoleszar

    Joined:
    Mar 21, 2022
    Posts:
    2
    THANK YOU!!!!!!!!!!!!!
     
  7. RayZhang707

    RayZhang707

    Joined:
    Dec 23, 2021
    Posts:
    1
    Just want to add that
    In another situation where Unity works fine but VS cannot find the namespace (e.g. in another imported package from unity asset store), trying lucernagame's solution (moving the folder which was imported at the root directory automatically, to the Assets/Scripts/ directory, will solve the issue.
    Note this is not the same problem (Unity not working vs. VS not working), but the fix is the same.