How to make Unity.Entities available in Visual Studio Code?

I’m setting up Unity 2018.1.3 for our current project. I wanted to experiment with Hybrid ECS and see if I could squeeze some performance. I’ve updated the manifest, restarted the editor, deleted solution and project files. I still can’t use Unity.Entities namespace. What did I miss?

Here’s what the manifest looks like:

{
  "registry": "https://staging-packages.unity.com",
  "dependencies": {
    "com.unity.render-pipelines.lightweight": "1.1.10-preview",
    "com.unity.package-manager-ui": "1.9.3",
    "com.unity.ads": "exclude",
    "com.unity.incrementalcompiler": "0.0.42-preview.4",
    "com.unity.entities": "0.0.12-preview.5"
  },
  "testables": [
    "com.unity.collections", 
    "com.unity.entities", 
    "com.unity.jobs"
  ]
}

I got it. Just forgot to manually add “Unity.Entities” to the asmdef file. This always gets me every time.

Thank you for reminding me how to get the namespace working. I did use that workaround some time ago for the TextMeshPro package but I didn’t realize it would be necessary for ECS, too.

1 Like

I am new in Unity, plz point out where to find this asmdef file? I am using VS community 2017, Unity 2018.2.

Is in your project folder. Search for manifest.json
MyUnityProject\Packeges\manifest.json

Just out of curiosity. Are you sure, you want to start with Unity ECS, rather than OOP?

That’s my manifest.json file.

{
  "dependencies": {
    "com.unity.ads": "2.0.9",
    "com.unity.analytics": "2.0.16",
    "com.unity.entities": "0.0.12-preview.8",
    "com.unity.incrementalcompiler": "0.0.42-preview.17",
    "com.unity.package-manager-ui": "1.9.11",
    "com.unity.purchasing": "2.0.3",
    "com.unity.textmeshpro": "1.2.4",
    "com.unity.modules.ai": "1.0.0",
    "com.unity.modules.animation": "1.0.0",
    "com.unity.modules.assetbundle": "1.0.0",
    "com.unity.modules.audio": "1.0.0",
    "com.unity.modules.cloth": "1.0.0",
    "com.unity.modules.director": "1.0.0",
    "com.unity.modules.imageconversion": "1.0.0",
    "com.unity.modules.imgui": "1.0.0",
    "com.unity.modules.jsonserialize": "1.0.0",
    "com.unity.modules.particlesystem": "1.0.0",
    "com.unity.modules.physics": "1.0.0",
    "com.unity.modules.physics2d": "1.0.0",
    "com.unity.modules.screencapture": "1.0.0",
    "com.unity.modules.terrain": "1.0.0",
    "com.unity.modules.terrainphysics": "1.0.0",
    "com.unity.modules.tilemap": "1.0.0",
    "com.unity.modules.ui": "1.0.0",
    "com.unity.modules.uielements": "1.0.0",
    "com.unity.modules.umbra": "1.0.0",
    "com.unity.modules.unityanalytics": "1.0.0",
    "com.unity.modules.unitywebrequest": "1.0.0",
    "com.unity.modules.unitywebrequestassetbundle": "1.0.0",
    "com.unity.modules.unitywebrequestaudio": "1.0.0",
    "com.unity.modules.unitywebrequesttexture": "1.0.0",
    "com.unity.modules.unitywebrequestwww": "1.0.0",
    "com.unity.modules.vehicles": "1.0.0",
    "com.unity.modules.video": "1.0.0",
    "com.unity.modules.vr": "1.0.0",
    "com.unity.modules.wind": "1.0.0",
    "com.unity.modules.xr": "1.0.0"
  },
  "registry": "https://staging-packages.unity.com",
  "testables": [
    "com.unity.collections",
    "com.unity.entities",
    "com.unity.jobs"
  ]
}

Unity has no problem with recognizing ECS, the issue is when VS put a red waived underline in lines like
using Unity.Entities;
or
static EntityManager entityManager;

Well, I am familiar with OOP and Entity Framework philosophy, I am pretty much new in Unity :slight_smile:

*.asmdef files are only visible if you’re using Assembly Definition files in your project. You probably don’t have these files if you’re new to Unity.

1 Like

Thats cool.

I just need apologize, as I just realized that I misread your question and you were referring to *.asmdef not manifest.json.

1 Like