Sites

Menu

Building

The default build for the C# worker sets up a project that should get you started quickly, lets you customize the build, and is upgradeable between SpatialOS versions. However, if you need to customize it further, you can turn off the automatic build script generation.

IDE support

After running spatial worker build for the first time, you should see a .sln file, which can be loaded in your IDE. Note that, by default, this file is overwritten every time a build is run. It is compatible and has been tested with Visual Studio 2017 Professional.

The default solution currently isn’t compatible with MonoDevelop and Xamarin. If you wish to customize the solution and project files to make them compatible with your IDE, turn off the automatic build script generation.

Project setup

The project is set up to have two configurations - Release and Debug - and three platforms for each - Windows64, Linux64, and macOS64, which build assemblies for 64-bit Windows, Linux, and macOS respectively.

These assemblies are bundled from the target directories of the build, so if you want to have additional resources statically available at runtime, put them in the target directory of the relevant configuration platform. Each of the assemblies contains compiled native code dependencies required to run instances of the worker type on the given platform. We currently don’t provide 32-bit versions of native dependencies.

You can also open the CsharpWorker solution in an editor of your choice, and build your code from there. The build system should pick up schema changes automatically when building from an editor. You need to run spatial worker build after an upgrade of SpatialOS to pick up the newest dependencies.

Source control ignored files

We recommend you add some files and directories to the list of ignored items in your source control system:

  • The usual suggested ignored C# project files (see an example .gitignore).
  • You might want to add improbable/ and logs/.
  • If you are using the default build scripts, you might also want to add spatialos.csharp.build.json, BuildTargets.targets, CsharpWorker.sln, CSharpWorker.targets, and spatialos_worker_packages.json.


————
2019-11-25 Page added with limited editorial review.

Search results

Was this page helpful?

Thanks for letting us know!

Thanks for your feedback

Need more help? Ask on the forums