#ArgumentException: System.ArgumentException: Unknown Type

1 messages · Page 1 of 1 (latest)

twilit wyvern
#

Hey Hey!
recently I opened my ECS Netcode Project after a break and ran into an error which I cannot seem to resolve on my own.
My google searches were rather dry on that topic.
The Error Message:
```ArgumentException: System.ArgumentException: Unknown Type:Unity.Networking.Transport.NetworkDriver All ComponentType must be known at compile time & be successfully registered. For generic components, each concrete type must be registered with [RegisterGenericComponentType].
This Exception was thrown from a function compiled with Burst, which has limited exception support.


I've followed the code a bit throughout and this Error is thrown within this very method of the ClientServerBootstrap Class from Unity.Netcode:
```cs
        public static World CreateServerWorld(string name)
        {
#if UNITY_CLIENT && !UNITY_SERVER && !UNITY_EDITOR
            throw new PlatformNotSupportedException("This executable was built using a 'client-only' build target. Thus, cannot create a server world. In your ProjectSettings, change your 'Client Build Target' to `ClientAndServer` to support creating client-hosted servers.");
#else

            var world = new World(name, WorldFlags.GameServer);

            var systems = DefaultWorldInitialization.GetAllSystems(WorldSystemFilterFlags.ServerSimulation);
            DefaultWorldInitialization.AddSystemsToRootLevelSystemGroups(world, systems);
            ScriptBehaviourUpdateOrder.AppendWorldToCurrentPlayerLoop(world);

            if (World.DefaultGameObjectInjectionWorld == null)
                World.DefaultGameObjectInjectionWorld = world;

            ServerWorlds.Add(world);
            return world;
#endif
        }

Generally I recreated my SimulationWorlds for the Server just to have clear name from my MonoBehaviour that runs as soon as the Application starts:

       private void RebuildSimulationWorlds()
        {
            Debug.Log("[SERVER:STARTUP] Disposing of local simulation worlds...");
            DestroyLocalSimulationWorld(); // Just disposes the World with FilterFlag=Game
            Debug.Log("[SERVER:STARTUP] Creating new server simulation world...");
            World server = ClientServerBootstrap.CreateServerWorld(_serverSimWorldName);
            Debug.Log("[SERVER:STARTUP] Assigning new server simulation world to default injection world...");
            World.DefaultGameObjectInjectionWorld ??= server;
            _serverSimulationWorld ??= server;
        }

Now the question is, am I using this wrong or is there a known Error?
Why has it broken now? Even as I dont create my Worlds manually using the Automatic Bootstrap I get this Error. I am not using the BurstCompile Attribute on the Monobehaviour where I use this Method.

primal fog
#

Are you getting the same error with burst off? If you turn burst off and on again, does it log an exception after compiling burst?

If it randomly started happening without up updating anything, then it could also be some corrupted artifact in your library folder, you could try deleting parts of it and see if it still happens after it regenerates.

twilit wyvern
#

With burst turned on I still get the same exception.
Normally I just delete the library folder as soon as some errors occur out of the blue.

I disabled burst, deleted the library folder and still getting the error.
Ill create a test project, maybe something else is broken within my project, wouldnt be the first time ^^

EDIT:
The thing thats weird is, everything still works as expected and how it should work.
The NetworkStreamDriver loads and opens ports, scene loading still works and also connections from clients.

twilit wyvern
#

Somehow the entire project got corrupted. Somehow even new assets get this error. I am making a new project and migrate my scripts.