The type or namespace name 'Entities' does not exist in the namespace 'Unity' (are you missing an as

Just upgraded my project to 2019 and jump on ECS. Ive installed all the packages but seeing missing assembly reference error. Please help, makes no sense

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

using UnityEngine;
using Unity.Entities;
using Unity.Rendering;
using Unity.Transforms;
using UnityEngine.SceneManagement;

namespace Test.HexSphereECS
{
bootstrapECS
    {
        [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
        public static void Init()
        {
        }
    }
}
1 Like

Can you show screenshot, with installed Entities in Package Manager? It works for me, so unless you installed something different by accident, restarting Unity may help?

Here is what i have
4523338--418723--Screen Shot 2019-05-10 at 12.07.19 AM.png

That looks indeed fine. In wore case, trying to 1 preview 30 of entities.

Does same happens after VS and Unity restart?

Restarting both did not work, Im stumped here

Wait l found ScriptsAssembly.asmdef in my main scripts folder, will this break it

It shouldn’t, as long it has dependencies assigned correctly.

Try remove it, or move script away from, to parent folder, and see if it works.

1 Like

Your assembly definition needs to reference the Entities package. I don’t know if the ‘Auto Referenced’ property is meant to do this for you but I’ve always had to manually link in the packages I use if I’m working with assembly definitions.

4 Likes

Thanks Guys that worked 4523437--418738--Screen Shot 2019-05-10 at 12.34.52 AM.png

2 Likes

I am facing the same issue, wherez assembly def references?

1 Like

I had the same issue, which I curcumvented differently, as I couldn’t “manually link in the packages I use” as JJJohan mentioned above.

Here’s my fix. Navigate to your manifest.json (typically under UnityProjects->PROJECTNAME->Packages->manifest) and add the following after your dependencies.

{
“dependencies”: {
// JSON removed for clarity
},
“registry”: “https://packages.unity.com”,
“testables”: [
“com.unity.collections”,
“com.unity.entities”,
“com.unity.jobs”
]
}

You can also be checking the dependencies section to ensure the packages are actually present.

I had the same issue. For me the classes and files where not added automatically to the assembly definition. The mistake I made was apparently, that I created the definition file inside the Rider IDE. I was able to see this when I switched to the solution view inside Rider.

When I create the definition in the unity Editor it correctly added all files to the assembly definition.

Dont contain .Unity. in your namespace.