ReSharp3DS is an experimental project that runs C# code on the Nintendo 3DS using nanoCLR / nanoFramework.
The project uses a C++ 3DS homebrew application to load C# assemblies compiled as .pe files, then executes them through nanoCLR.
Done (Click to expand)
- Initialize nanoCLR on Nintendo 3DS
- Load
mscorlib.peandapp.pefrom SD card - Execute C#
Program.Main() - Call native C++ functions from C# using
InternalCall - Basic Console API (
Clear,Write,WriteLine) - Input support (
Start,Select) - Runtime management (
Runtime.Yield(), static state preservation) - Validate on Citra & Real Hardware
- Fix screen flickering by avoiding full redraw every tick
To be implemented (Click to expand)
- Full Button Mapping (A, B, X, Y, D-Pad, L, R)
- Expanded Console API (bool, float, better formatting)
- Automatic native method binding instead of index-based mapping
- Graphics & Audio APIs
- Filesystem support
- Better error reporting for C# exceptions
- Proper SDK structure & templates
- Stabilize HOME Menu suspend/resume behavior
For the runtime to function correctly, your SD card must be organized as follows:
SD:/
├── 3ds/
│ └── ReSharp3DS.3dsx # The homebrew application
└── ReSharp3DS/ # Required data folder
├── mscorlib.pe # nanoFramework base library
└── app.pe # Your compiled C# program (user app)
Note: The runtime specifically looks for the assemblies in
sdmc:/ReSharp3DS/.
ReSharp3DS is meant for experimenting with managed C# code execution on the Nintendo 3DS. It can be used as a base to build 3DS homebrew logic in C#, test nanoCLR on non-standard platforms, and call native C++ code from C#.
Example:
namespace ReSharp3DS
{
public class Program
{
public static void Main()
{
Console.Clear();
Console.WriteLine("Hello from C# on 3DS!");
Console.WriteLine("Press START to quit.");
while (!Input.IsStartPressed())
{
Runtime.Yield();
}
Console.WriteLine("Bye.");
}
}
}- C++ Side: devkitPro (devkitARM, libctru, make).
- C# Side: nanoFramework-compatible compiler (e.g., nanoFramework.CoreLibrary).
- Hardware: A Nintendo 3DS with Luma3DS and Homebrew Launcher.
From the project folder, run:
make clean
makeThis generates ReSharp3DS.3dsx.
Compile your C# code into a .pe assembly using the nanoFramework toolchain. Rename the output file to app.pe.
- Copy
ReSharp3DS.3dsxtoSD:/3ds/. - Copy
mscorlib.peand yourapp.petoSD:/ReSharp3DS/(create the folder at the root of the SD if it doesn't exist). - Launch the app from the Homebrew Launcher.
If a file is missing or incorrectly placed, the program will display an error:
[FATAL] app load failed
Make sure the ReSharp3DS folder is at the root of the SD card, not inside the /3ds/ folder.
This project is not affiliated with Nintendo, Microsoft, the .NET Foundation, or the nanoFramework project. It is an experimental homebrew and runtime porting project intended for learning, research, and development purposes.