Building with C#: glue, API and SDK
Current .NET requirements, generation order, package contents and diagnostic failures.
A C# package includes the native editor/templates with managed integration enabled, generated bindings, managed API, tools and SDK packages. Building one EXE does not establish the complete package.
Current requirements
Source/modules/mono/global.json requests .NET SDK 10.0.100 with rollForward=latestMajor. ReckfellSharp, ReckfellSharpEditor and editor tools target net10.0. The old “.NET SDK 8+” requirement is insufficient for this tree. Check the selected SDK from the managed-project directory where global.json applies.
dotnet --info
python modules/mono/build_scripts/build_assemblies.py --helpRun the second command from Source. Building requires an SDK; runtime contents of the shipped editor/game need separate verification. mono is the current module’s option/path name; do not rename it to dotnet yourself.
Workflow
- Build the native editor with module_mono_enabled=yes and matching architecture/precision. Exports need corresponding template_debug/template_release builds with that module.
- Generate C# API from that editor’s ClassDB, without running a game project. This creates sources rather than building managed API DLLs.
- Check the generation log and files. After registered types/methods/parameters change, product version alone does not establish binding freshness.
- Run build_assemblies.py for the managed solutions and inspect outputs. Match precision and deprecated settings to the native configuration.
- Assemble the complete editor/export package and check project opening, C# building, execution and export.
For a configured Windows x64 environment, the sequence is below; replace editor with the actual name of your output:
python -m SCons platform=windows target=editor arch=x86_64 module_mono_enabled=yes
$editor = "./bin/reckfell.windows.editor.x86_64.mono.console.exe"
& $editor --headless --generate-mono-glue modules/mono/glue
python modules/mono/build_scripts/build_assemblies.py --reckfell-output-dir bin --reckfell-platform windows --werrorThese full-build commands were not executed here. Generation diagnostics used the installed editor and separate QA output; working Source files and the installed SDK were not replaced.
Expected artifacts
The generator writes C# API under ReckfellSharp/ReckfellSharp/Generated and ReckfellSharp/ReckfellSharpEditor/Generated relative to the specified glue directory. Ordinary source builds use modules/mono/glue.
build_assemblies.py builds managed solutions and copies API, XML/PDB and supporting files to ReckfellSharp/Api/Debug and Release inside reckfell-output-dir. Corresponding MSBuild projects/targets produce tools and NuGet packages. An arbitrary output directory is not automatically a complete portable distribution.
The editor needs matching API and tools beside the native binary; retain required runtime files and dependencies when distributing it. C# game distribution needs testing independently of startup on a machine with the SDK installed.
build_assemblies.py options
| Option | Purpose |
|---|---|
| --reckfell-output-dir | Required API output-data directory |
| --reckfell-platform | Platform configuration for managed tools; does not cross-compile the native engine |
| --precision=double | Match native precision=double; single is the default |
| --no-deprecated | Match native deprecated=no |
| --dev-debug | Debug tool configuration; API follows its own Debug/Release build sequence |
| --push-nupkgs-local | Copy packages to a local feed; also enables clearing corresponding cached versions through targets |
| --werror | Treat compilation warnings as errors in supported stages |
Do not change product version 1.0.0 to work around NuGet caching or require clearing the whole shared cache. Separate package sets from different builds: record feeds, versions and hashes; use a separate NUGET_PACKAGES environment when appropriate. NuGet.Config configures local feeds. Packages with the same number can contain different build outputs.
Observed generation failures
The checked invocation outside a game project created 1187 C# files, printed a successful-generation message and exited with code 0. Its log still contains 24 ERROR and 174 WARNING messages, including unresolved members in embedded XML documentation and Core-documentation references to editor types.
This operation is recorded as failed generation, not a healthy SDK. Files remain in QA and were not installed. Check logs, expected files, managed API compilation and actual project execution; exit 0 and “successfully generated” are insufficient. The current CLI handler can exit 0 after reporting errors.
The generator also retains hidden service wrappers, including the known ReckfellExtension stubs. A C# method declaration does not establish its functionality: see the extension-resource API.
Diagnose failures
| Symptom | Check |
|---|---|
| Missing SDK/target framework | Selected dotnet, global.json and net10.0 |
| Native editor does not understand the glue flag | Correct binary, enabled mono and supported generation mode |
| Generated files accompanied by ERROR messages | Do not accept the package; investigate the references/types and check API compilation |
| API mismatch at startup | Consistent native API, glue, managed DLLs, precision and deprecated settings |
| Restore uses an old package | NuGet feeds, exact version, chosen environment’s cache and package hash |
| Works only on the developer machine | Complete runtime, tools and export package |
This verification executed --help, dotnet --info and isolated glue generation. It did not rebuild the native engine, managed engine solutions, packages or an exported game.
Continue with SCons configuration, Windows builds.