Search Issue Tracker

Fixed

Votes

50

Found in [Package]

1.1.4

Issue ID

VSC-9

Regression

Yes

[VSCode] OmniSharp project reference warnings are thrown in VSCode console when using VSCode 1.1.4

Package: VS Code

-

How to reproduce:
1. Create a new Unity project
2. Make sure that your External Code Editor is set to VSCode and VSCode package version is 1.1.4
3. Click on Assets > Open C# Project
4. Once the VSCode window is open, go to the Output tab and inspect OmniSharp Logs

Expected results: No warnings regarding the referenced project being missed are thrown
Actual results: Many "Expected project reference Unity.TextMeshPro.Editor.csproj to be already loaded for project Assembly-CSharp" warnings are thrown

Reproducible with: 2019.2.19f1, 2019.3.0f6, 2020.1.0a20
Reproducible with package version: 1.1.4
Not reproducible with package version: 1.1.3

Notes:
1. Downgrading VSCode package to version 1.1.3 fixes the issue.
2. Reproduced on Windows and MacOS.

Comments (26)

  1. adecamillo

    Mar 09, 2020 15:25

    Reproduced with Unity 2019.3.0f6, package version 1.1.4, Windows 10

  2. caglarenes

    Mar 09, 2020 12:17

    Reproducible with 2019.3.4f1 on Windows 10 and OSX. Downgrading to 1.1.3 didn't work on both operating systems.

  3. NGC6543

    Feb 27, 2020 06:40

    Downgrading the package version to v1.1.3 doesn't solved the issue on Unity2019.3.2f1.

  4. Albob

    Feb 18, 2020 14:32

    Reproducible on 2019.2.15f1 with package version 1.1.4 on macOS Catalina 10.15.2

  5. bdrelling

    Feb 18, 2020 04:14

    Reproducible on 2019.3.0f6 and 2019.3.1f1 with package version 1.1.4 on macOS Catalina 10.15.2.

  6. ROBYER1

    Feb 17, 2020 08:39

    Reproduced on 2020.1.0a23 and it is very annoying as the package auto updates to the latest verified on these engine versions!

  7. Fethbita

    Feb 16, 2020 16:48

    Reproducible with 2019.3.1f1 and package version 1.1.4 on Windows 10.
    Reproducible with 2019.3.0f5 and package version 1.1.4 on Arch Linux.

  8. Odiobill

    Feb 09, 2020 10:11

    I'm also having the same issue since upgrading to 2019.3.0f6.

    Downgrading to 1.1.3 seems to fix the issue, but on the other hand, it makes the situation even worst since IntelliSense doesn't seem to work: no files are actually added to the workspace until you start changing something, and it can't autocomplete from other references.

    Upgrading again to 1.1.4 fixes the IntelliSense issue but brings back the hundreds of errors in the console and VSCode thinks that some files are broken, being unable to solve those references, while everything works in Unity.

  9. Alieldin

    Feb 03, 2020 21:36

    Confirmed, downgrading to 1.1.3 fixes the issue on Unity 2019.3.0f6, tested on Windows 10.

  10. dgileadi

    Jan 31, 2020 05:07

    I see this too, and 1.1.3 does fix it for me. For reference, with 1.1.4 I see the following error in the Unity Console:

    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 /Users/builduser/buildslave/unity/build/Editor/Mono/CodeEditor/CodeEditorProjectSync.cs:35)
    UnityEditor.AssetPostprocessingInternal.PostprocessAllAssets (System.String[] importedAssets, System.String[] addedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromPathAssets) (at /Users/builduser/buildslave/unity/build/Editor/Mono/AssetPostprocessor.cs:158)

    Debugging shows that this is because the DLL resolver is returning empty strings for some items. The code in ProjectGeneration.cs line 175 seems to assume that the string won't be empty, because it splits on ".dll" and then tries to access item zero in Split's returned string array. Since the returned array was empty it blows up. It should probably check for an empty string before trying to call the Split function.

    Hopefully this helps whoever is fixing this issue.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.