Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Mono-nx Switch: Difference between revisions

From GameBrew
No edit summary
No edit summary
 
(One intermediate revision 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 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 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.
Line 24: Line 24:
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].
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].


What works:
'''What works:'''
* Common BCL classes such as <code>List</code>, <code>StringBuilder</code> and so on.
* 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.
* P/Invoke, but only with libraries that were statically linked beforehand.
Line 33: Line 33:
* The interpreter seems rather stable even when running more complex programs, I did not test the AOT builds as much.
* The interpreter seems rather stable even when running more complex programs, I did not test the AOT builds as much.


What does not work:
'''What does not work:'''
* HTTPS and most of <code>System.Security</code> doesn't work because we have no openssl port on Switch.
* 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.
* Arbitrary P/Invoke doesn't work due to the lack of dynamic linking, all native function entrypoints must be defined beforehand and statically linked.
Line 39: Line 39:
* Also, exiting the interpreter and launching another dll or sometimes homebrew in the same hbmenu session will eventually crash.
* Also, exiting the interpreter and launching another dll or sometimes homebrew in the same hbmenu session will eventually crash.


Included demos:
'''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.
* 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.
* (*) pad_input.dll is a C# program that reads the controls with the native libnx api.

Latest revision as of 05:46, 12 December 2025

mono-nx
General
Authorexelix11
TypeDevelopments
Version0
LicenseMIT License
Last Updated2025/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 ListStringBuilder 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 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.Security 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 Console.ReadConsole.ClearProcess 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 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.

External links

Advertising: