Problems with ECS Samples

I’m unsuccessfully trying to revisit the samples project.

Initial Steps:

  1. Create new Unity project (2020.1.0a21.2690)
  2. Add freshly downloaded, unzipped ecs samples to the project’s assets directory
  3. Install Hybrid package.
  4. See a lot of warnings, errors.
  5. Restart Unity. Six errors remain, warnings gone.

The Errors

  • Assets\EntityComponentSystemSamples-master\EntityComponentSystemSamples-master\ECSSamples\Assets\Advanced\GridPath.Tests\CartesianGridOnCubeShortestPathTests.cs(5,22): error CS0234: The type or namespace name ‘Tests’ does not exist in the namespace ‘Unity.Entities’ (are you missing an assembly reference?)

  • Assets\EntityComponentSystemSamples-master\EntityComponentSystemSamples-master\ECSSamples\Assets\Advanced\GridPath.Tests\CartesianGridOnPlaneShortestPathTests.cs(5,22): error CS0234: The type or namespace name ‘Tests’ does not exist in the namespace ‘Unity.Entities’ (are you missing an assembly reference?)

  • Assets\EntityComponentSystemSamples-master\EntityComponentSystemSamples-master\ECSSamples\Assets\Advanced\GridPath.Tests\CartesianGridOnPlaneShortestPathTests.cs(11,58): error CS0246: The type or namespace name ‘ECSTestsFixture’ could not be found (are you missing a using directive or an assembly reference?)

  • Assets\EntityComponentSystemSamples-master\EntityComponentSystemSamples-master\ECSSamples\Assets\Advanced\GridPath.Tests\CartesianGridOnCubeShortestPathTests.cs(11,57): error CS0246: The type or namespace name ‘ECSTestsFixture’ could not be found (are you missing a using directive or an assembly reference?)

  • Assets\EntityComponentSystemSamples-master\EntityComponentSystemSamples-master\ECSSamples\Assets\StressTests\SubSceneTests\SubSceneTests.cs(4,22): error CS0234: The type or namespace name ‘Tests’ does not exist in the namespace ‘Unity.Entities’ (are you missing an assembly reference?)

  • Assets\EntityComponentSystemSamples-master\EntityComponentSystemSamples-master\ECSSamples\Assets\StressTests\SubSceneTests\SubSceneTests.cs(9,30): error CS0246: The type or namespace name ‘ECSTestsFixture’ could not be found (are you missing a using directive or an assembly reference?)

Next Steps:

  • When I try to roll back the Unity version to 2019.3.0f6 I get 28 warnings and 50 errors.
  • I restarted as 2020.1 again
  • I removed the outermost “EntityComponentSystemSamples-master” directory and errors 5 and 6 went away.
  • I deleted the test directories (GridPath.Tests and SubSceneTests) and once Unity recompiled I had 409 errors. The first few errors instructed me to Enable "Allow 'unsafe' code" in Player Settings to fix this error. I did as I was instructed (Edit > Project Settings > search ‘unsafe’) and when compiling finished again I had 379 errors.
  • I restarted Unity and the errors remained, most of which were missing namespaces. Double-clicking on the error opened a script in VS Code and I found a bunch of warnings like this:
The referenced project 'Unity.Timeline.Editor.csproj' does not exist.```

At this point I gave up. Anyone have a solution?

I think this is a problem outside of the samples project.

I started a brand new project, installed hybrid, and created a c# script. VS Code is throwing a bunch of warnings like the one I originally posted. I’ve verified .NET was enabled on my system and deleted the project’s .csproj and .sln files so they could be rebuilt. Situation didn’t change, so I retraced the steps for hooking up VS Code and Unity found here. Problem persists. No idea how I got this problem suddenly :\

VS Code is bork’d across all Unity versions and projects. I’m completely dead in the water until I find a solution. Suggestions online have been inadequate so far.

Rolling back Visual Studio Code Editor in the Packages tabs to version 1.3 fixed issues for most projects.
ECS Samples still has the six errors.

1 Like

If it’s super important, you can download jetbrains rider ide for a 30 day trial. Works out of the box from what I remember. (Been using it for 2 years now). It should at least get you going, unless the issue is something else entirely.

2 things :

  • are you sure it is not an issue with the alpha version of unity ? GitHub - Unity-Technologies/EntityComponentSystemSamples states reate or open a project with the Unity Editor (2019.3.0b11 or later to use the latest DOTS packages).

  • maybe they forgot to add the test package ? have you checked you asmdef file ?