Get SpatialOS

Sites

Menu

Troubleshooting

Xbuild bug

The generated build scripts use wildcards to specify which generated code sources should be compiled. xbuild (the Mono build tool) reports warnings about source files being included multiple times if they use wildcards, which is a known bug in the compiler. If you see warnings such as

CSC: warning CS2002: Source file `improbable\generated\improbable\test\TestComponent.cs' specified multiple times

or similar during your build, you can safely ignore them.

Assembly loading bug

The mechanism to resolve a component metaclass to the associated ComponentId (ComponentDatabase.MetaclassToId) can fail. If it does, you will get a KeyNotFoundException, with a stacktrace similar to the following:

 System.Collections.Generic.KeyNotFoundException: Could not find entry for type <YOUR-TYPE>
    at Improbable.Worker.Internal.ComponentDatabase.MetaclassToId[C]()
    ...

This occurs if the assembly containing the generated code has has not been loaded before your code runs, as assemblies are loaded lazily. You can work around this by manually loading the assembly, i.e. Assembly.Load("GeneratedCode"). GeneratedCode is the correct assembly name if you are using the generated build scripts, otherwise it may be different.

Was this page helpful?

Thanks for letting us know!

Thanks for your feedback

Need more help? Ask on the forums