A C# plugin loader for Monster Hunter World based on .NET 8.0.
For more detailed documentation and tutorials, visit the wiki.
- Install .NET 8.0 (Get the .NET Desktop Runtime 8.0.0)
- Download the latest release from the releases page and extract it into your Monster Hunter World directory.
- Install the Visual Studio 2022 17.8 Preview 2 or later.
- Create a new .NET 8.0 class library project and add a reference to
SharpPluginLoader.Core.dll
. - Create a class that implements the
SharpPluginLoader.Core.IPlugin
interface. - Implement the required methods.
- Put the compiled assembly into
nativePC/plugins/CSharp
. Assemblies are also allowed to be in subdirectories.
The native host (SharpPluginLoader.Native.dll
) loads the Bootstrapper assembly (SharpPluginLoader.Bootstrapper.dll
)
into the default AssemblyLoadContext (ALC). The Bootstrapper then loads the core assembly into a custom ALC (CoreLoadContext
).
The CoreLoadContext
resolves all dependencies either from the current directory, or via the Default ALC.
The core assembly then loads all plugins into a custom ALC (PluginLoadContext
) and resolves all dependencies from the CoreLoadContext
. Each plugin is loaded into a separate ALC.
- Make sure all projects are compiled in Debug mode.
- Open the
mhw-cs-plugin-loader
project properties, make sure the Debug configuration is selected and go to General > Debugging. Here set the Debugger Type to Mixed (.NET Core). - In the Attach to Process dialog, make sure Managed (.NET Core, .NET 5+) and Native are selected.
python -m venv venv
venv\Scripts\activate
pip install -r requirements.txt
mkdocs serve
- safetyhook - Native hooking library
- Reloaded.Hooks - Managed hooking library
- cimgui - C wrapper for Dear ImGui
- Dear ImGui - GUI library
- ImGui.NET - C# wrapper for Dear ImGui
- tinyobjloader - Wavefront OBJ loader
- nlohmann-json - C++ JSON library
- zlib - Compression library
- DirectXMath - DirectX Math library