Search Unity

Visual studio displays 'Entities' namespace does not exist error for Unity 2018.2.0b8

Discussion in 'Entity Component System' started by guywald, Jun 16, 2018.

  1. guywald

    guywald

    Joined:
    Aug 22, 2013
    Posts:
    13
    Unity beta 2018.2.0b8
    Visual Studio Community 7.4
    macOS High Sierra 10.13.5

    Cloned the https://github.com/Unity-Technologies/EntityComponentSystemSamples repo.
    The project plays and works, yet on Visual studio the message

    The type or namespace name 'Entities' does not exist in the namespace 'Unity' (are you missing an assembly reference?)

    The entities module lists in the Packages tab (in Unity), yet the 'Unity.Entities' does not appear in Visual Studio's assembly browser.

    Edit: Solved (sort of :| it works but not 100% sure why). See https://forum.unity.com/posts/3534332 for solution.

    In addition, the error in VS says (164 errors, this is one sample):
    /Users/guy/projects/ecs/EntityComponentSystemSamples/Samples/CSC: Error CS2001: Source file '/Users/guy/projects/ecs/EntityComponentSystemSamples/Samples/Packages/com.unity.mathematics/Unity.Mathematics/int3.cs' could not be found. (CS2001) (Unity.Mathematics)


    While Visual studio shows the package:
    Screen Shot 2018-06-16 at 21.40.02.png

    Clicking 'Reveal in Finder' directs to:
    /Users/guy/Library/Unity/cache/packages/packages.unity.com/com.unity.entities@0.0.12-preview.6
    rather than the /Users/guy/projects/ecs/EntityComponentSystemSamples/Samples/Packages/...

    This issue appeared in a few messages in the forum, yet the solutions did not solve this (besides using previous version).

    Any ideas?

    Update:
    Tried https://forum.unity.com/posts/3530913 solution of adding the mcs.rsp file to Assets/ folder, which still did not work (after re-importing, removing obj, Temp, Library folders and deleting the .csproj files...).

    Eventually I've tried Rider IDE which did get it to work.
    At some point I've opened Rider after pressing play.
    The AutoComplete worked, seems ok. This is some unknown voodoo.
     

    Attached Files:

    Last edited: Jun 16, 2018
  2. guywald

    guywald

    Joined:
    Aug 22, 2013
    Posts:
    13
    From Rider.
    Screen Shot 2018-06-16 at 23.55.35.png

    Ok, I this works for me:
    1. add the mcs.rsp (not sure if needed actually)
    2. changed the ide to Rider.
    3. deleted *.csproj
    4. full re-import
    5. restart unity
    6.
    Open Rider

    It takes a moment to import. but it works.


    My guess is, when Visual Studio is set, the csproj files generated are faulty.
    When setting Rider as ide, deleting the *.csproj files and re-importing they are re-created correctly.

    Note:
    When Visual Studio is set there are a lot of .csproj files generated, while when the other ide is set, there are a few.
     
    Last edited: Jun 16, 2018