This is a demo project to showcase exporting C# projects to the web platform. It was built using the new web export support coming to Godot 4.
Inspired by SharpLab, the demo uses Roslyn to compile arbitraty C# code at runtime and invokes it using the Mono interpreter.
Note
The demo requires multi-threading support which uses an experimental Mono runtime.
See more information about web exports for C# projects in the Live from GodotCon Boston: Web .NET prototype blog article and the Pull Request GH-106125 that implements it.
Try it out on https://lab.godotengine.org/godot-dotnet-web/
Requirements:
- Godot editor and template that supports exporting C# projects to web.
- PR: GH-106125
- .NET SDK 9.0+ with
wasm-toolsworkload installed.
Caution
Currently, the output index.js file needs to be manually edited to remove the DOTNET.setup call.
Export the game from the Godot editor's export dialog or use this command on a console:
godot --headless --export-release "Web" "out/index.html"Note
The output path out/index.html puts the exported project under the out directory.
You can also use the provided serve.py python script to serve the exported project on the local machine with a basic web server. This script was taken from the main Godot repository.
python serve.py --root outNote
The --root option specifies the directory that contains the exported project.
This project includes resources such as the .NET logo that is owned by the Microsoft corporation with no affiliation to this demo.
See also THIRD-PARTY-NOTICES.