Hello everyone,
My Unity project was working great yesterday but today it start throwing some errors and problems. I did’t change anything today. But Visual Studio Code was updating Omnisharp etc in the morning. I am not sure what is the main cause of problems. I am getting this error in Unity Console:
ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) (at <fb001e01371b4adca20013e0ac763896>:0)
System.ThrowHelper.ThrowArgumentOutOfRangeException () (at <fb001e01371b4adca20013e0ac763896>:0)
System.Collections.Generic.List`1[T].get_Item (System.Int32 index) (at <fb001e01371b4adca20013e0ac763896>:0)
CarSelection.LoadNewCar (System.Int32 playerNumber) (at D:/Unity Backups/Backup 41 Built in Pipeleine/Mini Racer Xtreme 5 Built In Pipeline/Assets/MCR Creator/Assets/Scripts/Menu/CarSelection.cs:291)
CarSelection.initCarSelection (System.Int32 NumberOfPlayer) (at D:/Unity Backups/Backup 41 Built in Pipeleine/Mini Racer Xtreme 5 Built In Pipeline/Assets/MCR Creator/Assets/Scripts/Menu/CarSelection.cs:243)
UnityEngine.Events.InvokableCall`1[T1].Invoke (T1 args0) (at <a979f18d51af41179d12b797e8c5be14>:0)
UnityEngine.Events.CachedInvokableCall`1[T].Invoke (System.Object[] args) (at <a979f18d51af41179d12b797e8c5be14>:0)
UnityEngine.Events.UnityEvent.Invoke () (at <a979f18d51af41179d12b797e8c5be14>:0)
UnityEngine.UI.Button.Press () (at C:/Program Files/2019.4.6f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/Button.cs:68)
UnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) (at C:/Program Files/2019.4.6f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/Button.cs:110)
UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at C:/Program Files/2019.4.6f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/ExecuteEvents.cs:50)
UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) (at C:/Program Files/2019.4.6f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/ExecuteEvents.cs:261)
UnityEngine.EventSystems.EventSystem:Update() (at C:/Program Files/2019.4.6f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/EventSystem.cs:377)
And these errors in Visual Studio Code:
Starting OmniSharp server at 8/17/2020, 9:55:37 PM
Target: d:\Unity Backups\Backup 43 Built\Mini Racer Xtreme 7 Built In Pipeline\Mini Racer Xtreme 3.sln
OmniSharp server started.
Path: c:\Users\Hi\.vscode\extensions\ms-dotnettools.csharp-1.23.0\.omnisharp\1.36.1\OmniSharp.exe
PID: 7056
[info]: OmniSharp.Stdio.Host
Starting OmniSharp on Windows 6.2.9200.0 (x64)
[info]: OmniSharp.Services.DotNetCliService
DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 1 MSBuild instance(s)
1: StandAlone 16.8.0 - "c:\Users\Hi\.vscode\extensions\ms-dotnettools.csharp-1.23.0\.omnisharp\1.36.1\.msbuild\Current\Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
MSBUILD_EXE_PATH environment variable set to 'c:\Users\Hi\.vscode\extensions\ms-dotnettools.csharp-1.23.0\.omnisharp\1.36.1\.msbuild\Current\Bin\MSBuild.exe'
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: StandAlone 16.8.0 - "c:\Users\Hi\.vscode\extensions\ms-dotnettools.csharp-1.23.0\.omnisharp\1.36.1\.msbuild\Current\Bin"
CscToolExe = csc.exe
CscToolPath = c:\Users\Hi\.vscode\extensions\ms-dotnettools.csharp-1.23.0\.omnisharp\1.36.1\.msbuild\Current\Bin\Roslyn
MSBuildExtensionsPath = c:\Users\Hi\.vscode\extensions\ms-dotnettools.csharp-1.23.0\.omnisharp\1.36.1\.msbuild
MSBuildToolsPath = c:\Users\Hi\.vscode\extensions\ms-dotnettools.csharp-1.23.0\.omnisharp\1.36.1\.msbuild\Current\Bin
[info]: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in 'd:\Unity Backups\Backup 43 Built\Mini Racer Xtreme 7 Built In Pipeline'.
[info]: OmniSharp.Cake.CakeProjectSystem
Could not find any Cake files
[info]: OmniSharp.MSBuild.ProjectSystem
Detecting projects in 'd:\Unity Backups\Backup 43 Built\Mini Racer Xtreme 7 Built In Pipeline\Mini Racer Xtreme 3.sln'.
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for 'd:\Unity Backups\Backup 43 Built\Mini Racer Xtreme 7 Built In Pipeline\Assembly-CSharp.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for 'd:\Unity Backups\Backup 43 Built\Mini Racer Xtreme 7 Built In Pipeline\GoogleMobileAds.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for 'd:\Unity Backups\Backup 43 Built\Mini Racer Xtreme 7 Built In Pipeline\Assembly-CSharp-firstpass.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for 'd:\Unity Backups\Backup 43 Built\Mini Racer Xtreme 7 Built In Pipeline\Assembly-CSharp-Editor-firstpass.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for 'd:\Unity Backups\Backup 43 Built\Mini Racer Xtreme 7 Built In Pipeline\GoogleMobileAds.Editor.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for 'd:\Unity Backups\Backup 43 Built\Mini Racer Xtreme 7 Built In Pipeline\Assembly-CSharp-Editor.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in 'd:\Unity Backups\Backup 43 Built\Mini Racer Xtreme 7 Built In Pipeline'.
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: d:\Unity Backups\Backup 43 Built\Mini Racer Xtreme 7 Built In Pipeline\Assembly-CSharp.csproj
[info]: OmniSharp.Script.ScriptProjectSystem
Could not find any CSX files
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.ImplementTypeWorkspaceOptionsProvider, Order: 110
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.BlockStructureWorkspaceOptionsProvider, Order: 140
[info]: OmniSharp.WorkspaceInitializer
Configuration finished.
[info]: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location 'd:\Unity Backups\Backup 43 Built\Mini Racer Xtreme 7 Built In Pipeline' on host 11288.
[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
[warn]: OmniSharp.MSBuild.ProjectManager
Failed to load project file 'd:\Unity Backups\Backup 43 Built\Mini Racer Xtreme 7 Built In Pipeline\Assembly-CSharp.csproj'.
d:\Unity Backups\Backup 43 Built\Mini Racer Xtreme 7 Built In Pipeline\Assembly-CSharp.csproj
c:\Users\Hi\.vscode\extensions\ms-dotnettools.csharp-1.23.0\.omnisharp\1.36.1\.msbuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1178,5): Error: 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
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: d:\Unity Backups\Backup 43 Built\Mini Racer Xtreme 7 Built In Pipeline\GoogleMobileAds.csproj
[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
[warn]: OmniSharp.MSBuild.ProjectManager
Failed to load project file 'd:\Unity Backups\Backup 43 Built\Mini Racer Xtreme 7 Built In Pipeline\GoogleMobileAds.csproj'.
d:\Unity Backups\Backup 43 Built\Mini Racer Xtreme 7 Built In Pipeline\GoogleMobileAds.csproj
c:\Users\Hi\.vscode\extensions\ms-dotnettools.csharp-1.23.0\.omnisharp\1.36.1\.msbuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1178,5): Error: 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
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: d:\Unity Backups\Backup 43 Built\Mini Racer Xtreme 7 Built In Pipeline\Assembly-CSharp-firstpass.csproj
[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
[warn]: OmniSharp.MSBuild.ProjectManager
Failed to load project file 'd:\Unity Backups\Backup 43 Built\Mini Racer Xtreme 7 Built In Pipeline\Assembly-CSharp-firstpass.csproj'.
d:\Unity Backups\Backup 43 Built\Mini Racer Xtreme 7 Built In Pipeline\Assembly-CSharp-firstpass.csproj
c:\Users\Hi\.vscode\extensions\ms-dotnettools.csharp-1.23.0\.omnisharp\1.36.1\.msbuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1178,5): Error: 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
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: d:\Unity Backups\Backup 43 Built\Mini Racer Xtreme 7 Built In Pipeline\Assembly-CSharp-Editor-firstpass.csproj
[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
[warn]: OmniSharp.MSBuild.ProjectManager
Failed to load project file 'd:\Unity Backups\Backup 43 Built\Mini Racer Xtreme 7 Built In Pipeline\Assembly-CSharp-Editor-firstpass.csproj'.
d:\Unity Backups\Backup 43 Built\Mini Racer Xtreme 7 Built In Pipeline\Assembly-CSharp-Editor-firstpass.csproj
c:\Users\Hi\.vscode\extensions\ms-dotnettools.csharp-1.23.0\.omnisharp\1.36.1\.msbuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1178,5): Error: 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
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: d:\Unity Backups\Backup 43 Built\Mini Racer Xtreme 7 Built In Pipeline\GoogleMobileAds.Editor.csproj
[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
[warn]: OmniSharp.MSBuild.ProjectManager
Failed to load project file 'd:\Unity Backups\Backup 43 Built\Mini Racer Xtreme 7 Built In Pipeline\GoogleMobileAds.Editor.csproj'.
d:\Unity Backups\Backup 43 Built\Mini Racer Xtreme 7 Built In Pipeline\GoogleMobileAds.Editor.csproj
c:\Users\Hi\.vscode\extensions\ms-dotnettools.csharp-1.23.0\.omnisharp\1.36.1\.msbuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1178,5): Error: 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
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: d:\Unity Backups\Backup 43 Built\Mini Racer Xtreme 7 Built In Pipeline\Assembly-CSharp-Editor.csproj
[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
[warn]: OmniSharp.MSBuild.ProjectManager
Failed to load project file 'd:\Unity Backups\Backup 43 Built\Mini Racer Xtreme 7 Built In Pipeline\Assembly-CSharp-Editor.csproj'.
d:\Unity Backups\Backup 43 Built\Mini Racer Xtreme 7 Built In Pipeline\Assembly-CSharp-Editor.csproj
c:\Users\Hi\.vscode\extensions\ms-dotnettools.csharp-1.23.0\.omnisharp\1.36.1\.msbuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1178,5): Error: 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
[fail]: OmniSharp.MSBuild.ProjectManager
Attempted to update project that is not loaded: d:\Unity Backups\Backup 43 Built\Mini Racer Xtreme 7 Built In Pipeline\Assembly-CSharp.csproj
[fail]: OmniSharp.MSBuild.ProjectManager
Attempted to update project that is not loaded: d:\Unity Backups\Backup 43 Built\Mini Racer Xtreme 7 Built In Pipeline\GoogleMobileAds.csproj
[fail]: OmniSharp.MSBuild.ProjectManager
Attempted to update project that is not loaded: d:\Unity Backups\Backup 43 Built\Mini Racer Xtreme 7 Built In Pipeline\Assembly-CSharp-firstpass.csproj
[fail]: OmniSharp.MSBuild.ProjectManager
Attempted to update project that is not loaded: d:\Unity Backups\Backup 43 Built\Mini Racer Xtreme 7 Built In Pipeline\Assembly-CSharp-Editor-firstpass.csproj
[fail]: OmniSharp.MSBuild.ProjectManager
Attempted to update project that is not loaded: d:\Unity Backups\Backup 43 Built\Mini Racer Xtreme 7 Built In Pipeline\GoogleMobileAds.Editor.csproj
[fail]: OmniSharp.MSBuild.ProjectManager
Attempted to update project that is not loaded: d:\Unity Backups\Backup 43 Built\Mini Racer Xtreme 7 Built In Pipeline\Assembly-CSharp-Editor.csproj
While i have the latest NET Framework v4.8 installed already.
I also tried with some old backups of this project but I am getting same errors.