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.