Search Issue Tracker

Fixed in 1.2.0

Votes

14

Found in [Package]

1.1.4

1.1.4

Issue ID

VSC-8

Regression

Yes

IndexOutOfRangeException is thrown when opening a project with Visual Studio Code set as preferred External Script Editor

Package: VS Code

-

How to reproduce:
1. Create and open a project
2. In 'Preferences' > 'External Tools' set Visual Studio Code as your preferred External Script Editor
3. Re-open the project
4. Observe the Console window

Expected result: no errors are thrown
Actual result: IndexOutOfRangeException is thrown

Reproducible with: 2019.2.20f1, 2019.3.0f6, 2020.1.0a22 (1.1.4)
Not reproducible with: 2019.2.20f1, 2019.3.0f6, 2020.1.0a22 (1.0.2, 1.1.2, 1.1.3)
Could not test with: 2017.4.36f1, 2018.4.17f1 (package not available)

Note: in 2019.2.20f1 the issue reproduces after installing the 1.1.4 package version instead of opening the Editor

Thrown exception:
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)

Comments (11)

  1. Fb074ba72f5300d3962c474711483a96?d=mm

    UDN_f80b201d-9653-4c20-8aec-edc4445f4637

    Mar 22, 2020 22:19

    Installing mono I've fixed the problem!

  2. 44d8a3f5c37bd0f228fae6ea2bfd1350?d=mm

    Shpinxis

    Mar 10, 2020 03:37

    Really hoping this gets fixed, it's really annoying.

  3. 4818676e0c2d2ecfe85adde06b8f31fc?d=mm

    polyphonic13

    Feb 29, 2020 16:31

    I am getting the same error with Editor v2019.3.2f1. This is happening with an existing game. It only started happening after a delete of ProjectSettings directory (due to a different, build issue.)

  4. F39d90cab55adf808cc8fcddf1364053?d=mm

    Masiorama

    Feb 24, 2020 19:11

    Same for me.

  5. 5be441d5568ceaf6e69a6d159d74ee13?d=mm

    jhon-avila

    Feb 23, 2020 19:35

    I am having this problem also, it's quite annoying...

  6. C11c326eb93ed5cfa1dddaf1d7c98c85?d=mm

    bao007fei

    Feb 20, 2020 13:24

    1.1.3 works fine.
    1.1.4 throw this error all the time. pretty annoying.

  7. 40237f352ba43c954f39bc3fe65ca28f?d=mm

    IlkerHadzhalaran

    Feb 04, 2020 16:29

    I have the same issue

  8. 7cd8c163a15fab73983cfffbd9b99001?d=mm

    Cool_Flow

    Feb 03, 2020 11:43

    While this is a annoying bug there is a quick workaround. Go into your package manager and downgrade Visual Studio Code Editor from 1.1.4 to 1.1.3. The issue will be fixed immediately.

  9. 429eb71018cf342371f7ee097a941703?d=mm

    Organik05

    Feb 02, 2020 23:48

    I have this same issue!

  10. B3800a0c4ec0a568831674b3253efe20?d=mm

    qvinh222

    Feb 02, 2020 22:35

    I have the same problem.
    Unity 2019.3.0f6
    VScode package 1.1.4

    error:

    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 <6f28216fea9f453abf2e05b770ed3ee4>:0)
    UnityEditor.AssetPostprocessingInternal.PostprocessAllAssets (System.String[] importedAssets, System.String[] addedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromPathAssets) (at <6f28216fea9f453abf2e05b770ed3ee4>:0)

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.