A library for patching, replacing, and decorating .NET and Mono methods during runtime, enabling non-destructive code modifications.
Harmony is a .NET library that enables runtime patching, replacement, and decoration of methods in C# applications. It allows developers to modify the behavior of existing code without altering the original source, making it particularly useful for game modding, plugin development, and unit testing scenarios where direct code changes are impractical.
C# developers creating mods or plugins for games, extending third-party applications, or needing runtime code modifications for testing and debugging purposes.
Developers choose Harmony for its non-destructive patching approach, support for multiple coexisting patches, and seamless runtime operation without file modifications, offering a robust alternative to traditional method replacement techniques.
A library for patching, replacing and decorating .NET and Mono methods during runtime
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Keeps original methods intact while allowing custom code to run before, after, or around them, enabling safe modifications without altering source files as described in the philosophy.
Operates entirely at runtime without file changes or recompilation, making it ideal for plugins and mods in live applications, highlighted in the installation and how-it-works sections.
Allows multiple patches to be applied simultaneously without conflicts, ensuring stability in mod-heavy environments like the listed games.
Supports .NET and Mono environments, including popular game engines and applications such as RimWorld and Stardew Valley, as evidenced in the README's usage examples.
Harmony 1 and 2 are not compatible, forcing migrations with potential breaking changes, as noted in the documentation about deprecated versions.
The thin package requires manual handling of dependencies, adding setup complexity compared to the merged assembly, as mentioned in the installation instructions.
Low-level modifications via IL code processors demand deep understanding of .NET internals, which can be a barrier for developers unfamiliar with assembly-level tweaks.