Search Unity

[Visual Studio Code Editor 1.1.4] Error: The referenced project does not exist

Discussion in 'Code Editors & IDEs' started by jasonatkaruna, Jan 9, 2020.

  1. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,453
    It's been a hot minute, where is 1.1.5 at and why did such a buggy version get 'verified'?! Destroys my trust in Unity when things don't get tested for regressions.
     
  2. kristoof

    kristoof

    Joined:
    Aug 26, 2013
    Posts:
    89
    Downgrading to 1.1.3 has also fixed it for me. I'm really mad about this, I had a day of downtime trying to uninstall and reinstall every SDK. I also fully agree with ROBYER1's previous comment.
     
  3. DunaSpace

    DunaSpace

    Joined:
    Apr 17, 2018
    Posts:
    3
    Same issue with Unity 2019.3.3f1
    "Visual Studio Code Editor" version 1.1.4 bugged my existing project
    I had the "Generate all .csproj files" activated cause I use it a lot, but even with, the editor kept spitting warning and errors

    Solution was, as suggested above in previous posts, downgrade the version from 1.1.4 to 1.1.3
    go to Window -> Package Manager -> "Visual Studio Code Editor" click on remove, click the dropdown at the left of the name, click see all versions, click "1.1.3", and click install at the bottom

    The bug is still there in 2019.3.3f1
     
  4. FlantasticDan

    FlantasticDan

    Joined:
    Mar 4, 2020
    Posts:
    1
    I'd been pulling my hair out for an hour before I found this thread and it solved my problems immediately.

    @Unity maybe stop releasing updates that break things?
     
  5. jasonatkaruna

    jasonatkaruna

    Joined:
    Feb 26, 2019
    Posts:
    64
    UPDATE:

    Still receiving errors for a couple namespaces in my project:

    - UnityEngine.InputSystem
    - UnityEngine.UI
     
    ROBYER1 likes this.
  6. EricBeato

    EricBeato

    Joined:
    Feb 19, 2015
    Posts:
    2
    I think the problem is actually with the vscode extension for C#, they changed the package name from ms-vscode.csharp to ms-dotnettools.csharp, (Change Marketplace publisher for the C# extension from ms-vscode to ms-dotnettools) on v1.21.13, downgrading to v1.21.12 fixed it for me, but it has to be done manually.
     
    ROBYER1 likes this.
  7. EricBeato

    EricBeato

    Joined:
    Feb 19, 2015
    Posts:
    2
    ROBYER1 likes this.
  8. Incode

    Incode

    Joined:
    Apr 5, 2015
    Posts:
    78
    This is actually a separate issue as of today (and no fault of Unity's), the other issue is still very much a problem and Unity has an open ticket for it.
     
    EricBeato likes this.
  9. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,453
    So now we have the v1.1.4 issue AND ALSO the C# version v1.21.13 issue, WHAT JOY.

    Boy am I glad I chose to use VS code now..NOT
     
  10. Incode

    Incode

    Joined:
    Apr 5, 2015
    Posts:
    78
    Yeah, the level of friction caused by issues like these has been unacceptable in 2019.3.
     
    ROBYER1 likes this.
  11. paulbettner

    paulbettner

    Joined:
    Jan 13, 2014
    Posts:
    14
    ROBYER1 and EricBeato like this.
  12. bigboer

    bigboer

    Joined:
    Aug 8, 2012
    Posts:
    3
    For me it worked upgrading the project settings to Api compatibility level .NET 4.x
     
  13. greg-harding

    greg-harding

    Joined:
    Apr 11, 2013
    Posts:
    524
    ROBYER1 likes this.
  14. jasonatkaruna

    jasonatkaruna

    Joined:
    Feb 26, 2019
    Posts:
    64
    When doing this, make sure to select all of the checkboxes in your preferences to generate .csproj files. I've done that and have the latest versions of vscode 1.43, C# extension 1.21.14, and unity debugger 2.7.3. You can also enable the code analyzers! The changelog mentions something about being able to use custom code analyzers now with vscode, so I'm gonna check that out and see how it is!
     
    ROBYER1 likes this.
  15. fmoo

    fmoo

    Joined:
    May 31, 2015
    Posts:
    18
    Hm, I just tried v1.2.0 and restarted vscode and it didn't help.

    Just downgraded to 1.1.3 and restarted vscode and everything works fine.

    If there extra settings required for 1.2.0 to work properly, shouldn't they be selected automatically when installing/running the package?

    Edit: I tried 1.2.0 once more, and after enabling all the project file generation options in Edit > Preferences > External Tools, and restarting vscode, and waiting a few minutes, things seemed to start working.
     
    Last edited: Mar 16, 2020
    goncalo-vasconcelos and ROBYER1 like this.
  16. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,453
    Incode likes this.
  17. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,453
  18. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,453
    Did it auto-update as it is pre-release?
     
  19. jasonatkaruna

    jasonatkaruna

    Joined:
    Feb 26, 2019
    Posts:
    64
    ROBYER1 likes this.
  20. wedge_one

    wedge_one

    Joined:
    Mar 13, 2017
    Posts:
    2
    Installed the preview 1.2.0 version and fixed IntelliSense on VSCode with C# 1.21.14 and Debugger 2.7.5
     
  21. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,453
    Yep got to that then the debugger completely borks out, not amused with the experience so far!
     
    jasonatkaruna likes this.
  22. NickVst

    NickVst

    Joined:
    Feb 17, 2017
    Posts:
    25
    Generating all C# project files worked on my end. Think I had to update a script to force recompilation though.

    Unity 2019.3.6f1
    Visual Studio Code 1.42.1 running C# 1.21.15
    VSCode Editor package 1.1.4
     
  23. Aykutkaraca

    Aykutkaraca

    Joined:
    Jan 4, 2018
    Posts:
    33
    nothing works for me. I am going nuts. After all these years I wanted to go back using Unity under Linux but..
    Unity 2019.3.6f1,
    Visual Studio Code editor rolled back to 1.1.4
    VSCode 1.41.1 running C#1.21.12 Debugger 2.7.3

    after trying all the newest versions, I tried above but still not working. I have mono and all dotnet etc but Unity keeps inserting targetplatform v4.7.1 which is a windows net framework windows version. I am on Linux so I get errors like:

    The reference assemblies for .NETFramework,Version=v4.7.1 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack)
     
  24. Incode

    Incode

    Joined:
    Apr 5, 2015
    Posts:
    78
    Try rolling back to 1.1.3. There have been known issues with 1.1.4.
     
  25. Aykutkaraca

    Aykutkaraca

    Joined:
    Jan 4, 2018
    Posts:
    33
    I fixed it. I had the wrong repository for mono so I removed and reinstalled mono with correct Debian version and it all worked. I have the latest versions of all components. It works like charm. I am so happy!!! Unity works extremely fast on Linux. at least for me.
     
    Incode likes this.
  26. SupinePandora43

    SupinePandora43

    Joined:
    May 13, 2019
    Posts:
    18
    i got this error in console when starting unity
    IndexOutOfRangeException: Index was outside the bounds of the array.
    VSCodeEditor.ProjectGeneration.<SyncIfNeeded>b__25_0 (System.String asset) (at Library/PackageCache/com.unity.ide.vscode@1.1.4/Editor/ProjectGeneration/ProjectGeneration.cs:175)
    System.Linq.Enumerable+SelectListIterator`2[TSource,TResult].MoveNext () (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
    System.Linq.Enumerable+ConcatIterator`1[TSource].MoveNext () (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
    System.Collections.Generic.HashSet`1[T].UnionWith (System.Collections.Generic.IEnumerable`1[T] other) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
    System.Collections.Generic.HashSet`1[T]..ctor (System.Collections.Generic.IEnumerable`1[T] collection, System.Collections.Generic.IEqualityComparer`1[T] comparer) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
    System.Collections.Generic.HashSet`1[T]..ctor (System.Collections.Generic.IEnumerable`1[T] collection) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
    VSCodeEditor.ProjectGeneration.SyncIfNeeded (System.Collections.Generic.List`1[T] affectedFiles, System.String[] reimportedFiles) (at Library/PackageCache/com.unity.ide.vscode@1.1.4/Editor/ProjectGeneration/ProjectGeneration.cs:177)
    VSCodeEditor.VSCodeScriptEditor.SyncIfNeeded (System.String[] addedFiles, System.String[] deletedFiles, System.String[] movedFiles, System.String[] movedFromFiles, System.String[] importedFiles) (at Library/PackageCache/com.unity.ide.vscode@1.1.4/Editor/VSCodeScriptEditor.cs:139)
    UnityEditor.CodeEditorProjectSync.PostprocessSyncProject (System.String[] importedAssets, System.String[] addedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromAssetPaths) (at <78f1ad0f25c84e3ca853e639f50d95f5>:0)
    UnityEditor.AssetPostprocessingInternal.PostprocessAllAssets (System.String[] importedAssets, System.String[] addedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromPathAssets) (at <78f1ad0f25c84e3ca853e639f50d95f5>:0)
     
    SirIntruder likes this.
  27. SupinePandora43

    SupinePandora43

    Joined:
    May 13, 2019
    Posts:
    18
    installing net framework v4.1 Developer pack helped me in fixing "cannot update project Unity.Engine.csproj cuz it not loaded"
    DEVELOPER PACK, not only runtime!
    downgrade to 1.1.3 fixed problem above


    check out 1.2 it added button "Regenerate csproj"
     
  28. tcz8

    tcz8

    Joined:
    Aug 20, 2015
    Posts:
    504
    Last edited: Apr 3, 2020
  29. tcz8

    tcz8

    Joined:
    Aug 20, 2015
    Posts:
    504
    I can't seem to find that unity package you speak of in my package manager, is this for a specific operating system or unity version? Also, I dont have a box I can check that says "generate .csproj".
     
  30. ExNinja

    ExNinja

    Joined:
    Dec 4, 2013
    Posts:
    30
    I can confirm that https://forum.unity.com/threads/vis...d-project-does-not-exist.806628/#post-5483262 worked for me:

    urmund's steps:

    1. Changed "com.unity.ide.vscode": "1.1.3" in "Packages/manifest.json"
    2. Set "Generate all .csproj files" to true in "Preferences"

    (I still got lots of warnings like:
    [warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.TextMeshPro.Editor.csproj' does not exist.)

    3. Performed "Assets > Reimport All"
    4. It works!

    MacBook Pro 16", Unity 2019.2.21f1
     
    koopzi likes this.
  31. XLoad

    XLoad

    Joined:
    Oct 7, 2019
    Posts:
    2
    The steps here worked for me!
    Also I ticked the "Generate all .csproj files" in Unity > Edit > Preferences > External Tools
     
  32. SirIntruder

    SirIntruder

    Joined:
    Aug 16, 2013
    Posts:
    49
    Can Unity finally change "verified" version of vscode package for 2019.3 away from 1.1.4?
    I now have to remember to manually update package version every time I create new project, or open old projects?
    Every day somebody on vscode-c# github files an issue about this, and they have to be instructed to fix this manually
     
    EvOne likes this.
  33. snowinrain

    snowinrain

    Joined:
    Jan 17, 2016
    Posts:
    15
    Upgrade to version 1.2.0 worked for me.

    Window -> Package Manager -> Find "vscode" -> select version 1.2.0 -> Click "Up to date" button
     
    alexjorgef likes this.
  34. Marky5959

    Marky5959

    Joined:
    Oct 8, 2017
    Posts:
    1
    I'm getting what seems to be the same problem with visual studio community. Was working fine 2 days ago, now it's just a mess.

    I'm not sure how or if these solutions can be applied to visual studio community?

    I'm very much a newbie to all this and accidentally ran code cleanup and it may have mistakenly removed a lot of 'unnecessary' stuff that's going to take me a while to clean up now as it is. I've also tried ticking "Generate all .csproj files" but no luck.

    I don't want to mess about with it any further without knowing what I should be doing. Any help would be greatly appreciated.

    EDIT - Ok it was my own fault for updating to 2020.1.0b6 I switched back to 2019.3.11f1 and reverted back to an old version and it seems ok now.
     
    Last edited: Apr 26, 2020
  35. martt_1er

    martt_1er

    Joined:
    Mar 9, 2015
    Posts:
    6
    Hi everyone.
    As many of you, I tried everything in this thread.
    1/ Downgrading to 1.1.3 reduce a lot the amount of omnisharp errors (those [fail] in the VSC console) but there are still 4 errors :
    the classic

    [fail]: OmniSharp.MSBuild.ProjectLoader
    The reference assemblies for .NETFramework,Version=v4.7.1 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks

    (twice)

    and 2 errors like :

    [fail]: OmniSharp.MSBuild.ProjectManager
    Attempted to update project that is not loaded: /Users/martin/Development/unity/Experiments/Assembly-CSharp.csproj


    Plateform: macos Catalina
    Unity: 2019.3.10f1
    Mono version: 6.8.0.105
    dotnet version: 3.1.201

    2/ @AnthonyPalma suggest to a/ create a new project, and b/ update to Unity 2020.1.a23
    2.a/ creating a new project removes all the errors ! \o/
    BUT,
    - it seems that code completion still don't work for Unity SDK (for example, "trans" or "gameobj" do not autocomplete into "transform" or "gameobject")
    - when I transfers all Asset/ files from my not working project to the new one, and I reload VSCode, the errors come again. I suspect them to be related to the imported libraries.
    - Impossible to launch a debug session. I just cannot find the option to attach Unity process. But this may not be related to this thread since the VSCode UI did change since last time I worked on Unity.

    2.b/ updating to 2020.1.2f1 does not remove the errors. Tried with VSCode package 1.1.3, 1.1.4 and the newly 1.2.0.

    3/ Downgrading VSCode C# extension to 1.21.12 (with manual install) does nothing. Same errors occurs on load.
     
    Last edited: Apr 29, 2020
  36. greg-harding

    greg-harding

    Joined:
    Apr 11, 2013
    Posts:
    524
    I feel your pain - getting the right combo can be tricky and it seems to break really easily.

    For reference, things are working for me with;
    - macOS 10.14.6
    - Unity 2017.4.39, 2019.2.17, 2019.3.11
    - Unity VSCode package 1.2.0 (for 2019.x)
    - VSCode 1.44.2
    - C# for VSCode extension 1.21.17
    - Mono 6.6.0.155

    Also, this just appeared in the 2019.3.12 release notes;
    - Editor: OmniSharp project reference warnings are thrown in VSCode console when using VSCode
    - Scripting: "Generate all .csproj files" setting needs to be toggled on every startup for all the csproj files to actually be generated
     
    Last edited: Apr 29, 2020
  37. hunabku94

    hunabku94

    Joined:
    Jun 12, 2017
    Posts:
    49
    Bugs still in 1.1.4, 1.2.0 and 1.2.1.
    Need to downgrade to 1.1.3 and delete project folder's .vscode folder to works correctly.

    I'm on Linux and mates use WIndows have also this bugs.
     
  38. diesoftgames

    diesoftgames

    Joined:
    Nov 27, 2018
    Posts:
    122
    Just wanted to chime in that this bug is still present. I got updated to the latest version of vscode package (1.2.3) accidentally when upgrading and eventually wound up in a bad spot again because of this. Here's what seems to work for me btw if you're trying to fix this problem:

    * Go into your {project_root}/Packages/manifest.json and downgrade to 1.1.3
    * Delete all the {project_root}/*.csproj files
    * Delete {project_root}/.vscode
    * Re-build your project in Unity
    * Open the project in vscode and now you should see it properly working in your output console

    NOTE: I'm on macOS (10.14) using Unity 2020.2.1f1
     
  39. calpolican

    calpolican

    Joined:
    Feb 2, 2015
    Posts:
    425
    This is still there in 2020.2.1f1, the problema appear out of nowhere, I wasn't doing anything fancy and all of the sudden, several assemblies unrecognized in VS. What I don't understand is why is this happening if I didn't upgrade nor unity nor VS? I tried to upgraded VS now and it didn't work. Someone said on the forums: "reimport all", and I'm now hoping I'd give more thought to it before doing it.
     
    brainwipe likes this.