Mono-nx Switch: Difference between revisions
From GameBrew
More actions
Created page with "{{Infobox Switch Homebrews |title=mono-nx |image=monoNXSwitch.png |description=An unofficial port of the mono runtime as a switch homebrew. |author=exelix11 |lastupdated=2025/05/22 |type=Developments |version=0 |license=MIT |download=https://github.com/exelix11/mono-nx/releases |website=https://www.reddit.com/r/dotnet/comments/1ks83mq/i_ported_the_mono_runtime_as_a_switch_homebrew/ |source=https://github.com/exelix11/mono-nx |donation= }} {{#seo: |title=Switch Homebrew P..." |
No edit summary |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 18: | Line 18: | ||
|image=monoNXSwitch.png | |image=monoNXSwitch.png | ||
|image_alt=mono-nx | |image_alt=mono-nx | ||
}} | }}{{lowercase title}} | ||
<!--https://dlhb.gamebrew.org/switchhomebrews/monoNXSwitch.7z--> | <!--https://dlhb.gamebrew.org/switchhomebrews/monoNXSwitch.7z--> | ||
This is an unofficial port of the mono runtime to the | This is an unofficial port of the mono runtime to the Switch homebrew toolchain. It can run dotnet 9.0 applications using the mono interpreter by loading the dll or exe files directly on console. It can also build .NET assemblies as static libraries using mono AOT. | ||
This release contains the binaries for the mono interpreter, the C# demos and the aot example homebrew. To build and use mono-nx, please follow the detailed step-by-step instructions provided in the [https://github.com/exelix11/mono-nx GitHub repository]. | |||
To build and use mono-nx, please follow the detailed step-by-step instructions provided in the [https://github.com/exelix11/mono-nx GitHub repository]. | |||
'''What works:''' | |||
* Common BCL classes such as <code>List</code>, <code>StringBuilder</code> and so on. | |||
* P/Invoke, but only with libraries that were statically linked beforehand. | |||
* Threads and async. | |||
* Most of filesystem APIs. | |||
* Sockets and http-only support for <code>HttpClient</code>. | |||
* .NET wrappers for SDL2 and [https://github.com/ocornut/imgui dear imgui] which are included as static libraries. | |||
* The interpreter seems rather stable even when running more complex programs, I did not test the AOT builds as much. | |||
'''What does not work:''' | |||
* HTTPS and most of <code>System.Security</code> doesn't work because we have no openssl port on Switch. | |||
* Arbitrary P/Invoke doesn't work due to the lack of dynamic linking, all native function entrypoints must be defined beforehand and statically linked. | |||
* Any other OS-dependant API that was not mentioned previously will likely not work because it was not explicitly implemented. Examples are <code>Console.Read</code>, <code>Console.Clear</code>, <code>Process</code> and many more. | |||
* Also, exiting the interpreter and launching another dll or sometimes homebrew in the same hbmenu session will eventually crash. | |||
'''Included demos:''' | |||
* aot_example.nro is a fully self-contained AOT-complied C# application. It generates a random number and asks you to guess it. | |||
* (*) pad_input.dll is a C# program that reads the controls with the native libnx api. | |||
* (*) example.dll is a C# program that shows most of the APIs that are currently implemented. | |||
* (*) explorer_demo.dll is a C# program that shows a file explorer-like GUI using imgui and SDL2. This will also work on windows and linux with no code changes if you use [https://github.com/exelix11/CimguiSDL2Cross/releases/tag/r2 the author's cimgui fork]. | |||
* (*) guess_number.exe is the source from aot_example built with plain csc.exe on a windows vm to show off loading exe files as well. I'm not aware of any way to build this on linux so there's no build script for it. | |||
(*) These will add the dll and exe file association to the hbmenu allowing you to launch them directly. | |||
==Changelog== | ==Changelog== | ||
| Line 30: | Line 53: | ||
== External links == | == External links == | ||
* | * GBAtemp - https://www.reddit.com/r/dotnet/comments/1ks83mq/i_ported_the_mono_runtime_as_a_switch_homebrew/ | ||
* | * GitHub - https://github.com/exelix11/mono-nx | ||
Latest revision as of 05:46, 12 December 2025
| mono-nx | |
|---|---|
| General | |
| Author | exelix11 |
| Type | Developments |
| Version | 0 |
| License | MIT License |
| Last Updated | 2025/05/22 |
| Links | |
| Download | |
| Website | |
| Source | |
This is an unofficial port of the mono runtime to the Switch homebrew toolchain. It can run dotnet 9.0 applications using the mono interpreter by loading the dll or exe files directly on console. It can also build .NET assemblies as static libraries using mono AOT.
This release contains the binaries for the mono interpreter, the C# demos and the aot example homebrew. To build and use mono-nx, please follow the detailed step-by-step instructions provided in the GitHub repository.
What works:
- Common BCL classes such as
List,StringBuilderand so on. - P/Invoke, but only with libraries that were statically linked beforehand.
- Threads and async.
- Most of filesystem APIs.
- Sockets and http-only support for
HttpClient. - .NET wrappers for SDL2 and dear imgui which are included as static libraries.
- The interpreter seems rather stable even when running more complex programs, I did not test the AOT builds as much.
What does not work:
- HTTPS and most of
System.Securitydoesn't work because we have no openssl port on Switch. - Arbitrary P/Invoke doesn't work due to the lack of dynamic linking, all native function entrypoints must be defined beforehand and statically linked.
- Any other OS-dependant API that was not mentioned previously will likely not work because it was not explicitly implemented. Examples are
Console.Read,Console.Clear,Processand many more. - Also, exiting the interpreter and launching another dll or sometimes homebrew in the same hbmenu session will eventually crash.
Included demos:
- aot_example.nro is a fully self-contained AOT-complied C# application. It generates a random number and asks you to guess it.
- (*) pad_input.dll is a C# program that reads the controls with the native libnx api.
- (*) example.dll is a C# program that shows most of the APIs that are currently implemented.
- (*) explorer_demo.dll is a C# program that shows a file explorer-like GUI using imgui and SDL2. This will also work on windows and linux with no code changes if you use the author's cimgui fork.
- (*) guess_number.exe is the source from aot_example built with plain csc.exe on a windows vm to show off loading exe files as well. I'm not aware of any way to build this on linux so there's no build script for it.
(*) These will add the dll and exe file association to the hbmenu allowing you to launch them directly.
Changelog
v0
- First Release.