sharp-runtime Documentation
A C++23 implementation of a practical subset of the .NET System.* namespace, available as focused CMake components.
System::* API compatibility
so that ported C#/XNA game code compiles with minimal changes. Applications can select
only the components they need; existing all-in integration remains available. It powers
CNA (C++ port of XNA 4.0) and mobile-eggbert.
Quick Start
# Clone the repository (with submodules)
git clone --recurse-submodules https://github.com/openeggbert/sharp-runtime.git
cd sharp-runtime
# Configure, build, and run the complete test suite
cmake -S . -B build -DSHARP_RUNTIME_COMPONENTS=All
cmake --build build --target SharpRuntimeTests --parallel 4
scripts/run_component_tests.sh build
Explore the Documentation
Project Overview
What sharp-runtime is, its goals, status, and relationship to CNA.
Getting Started
How to build, test, and integrate the complete runtime or selected components.
Architecture
Runtime layers, namespace design, key architectural decisions.
C# Compatibility
Mapping table from C# constructs to C++ sharp-runtime equivalents.
Type System
Primitive types, Object base class, SharpRuntimeHelper.
Exceptions
Exception hierarchy, throwing patterns, C# to C++ mapping.
Strings
std::string usage, System::String helpers, StringBuilder.
I/O Subsystem
Stream, File, Directory, Compression, IsolatedStorage.
Components & Modules
Browse the component catalogue, public targets, and subsystem reference.
Porting C# Code
Practical guide for porting C# classes to C++ using sharp-runtime.
Tutorials
Step-by-step guides for common tasks.
Known Limitations
What is not implemented, POSIX-only subsystems, known gaps.
Status Summary
| Metric | Value |
|---|---|
| Physical modules | 40 independently selectable components |
| Public headers | 983 headers across the module include roots |
| Test sources | 369 module-owned GoogleTest source files |
| C++ standard | C++23 |
| Build output | Selected component targets, with SharpRuntime::All for the complete runtime |
| Build system | CMake ≥ 3.20 |
| Primary platform | Linux / macOS |
| Additional platforms | Windows (partial), Android (SDL3), Emscripten (partial) |
| License | MIT |