Harmony is a library for patching, replacing and decorating .NET and Mono methods during runtime.
Harmony solves the problem of modifying application behavior in C# without access to source code or the ability to recompile. It enables runtime method patching through a high-level API that preserves the original method while allowing you to execute custom code before and after it, modify the method body using IL code processors, and apply multiple patches that coexist without conflicts. The library works entirely in memory without touching files on disk.
The tool suits developers building plugins or mods for host applications written in C#, particularly games built with Unity or other .NET-based engines. It is also used in unit testing scenarios at major technology companies. Harmony is well-established in commercial game titles and has proven stability in production environments. The library offers two installation paths: a single merged assembly through the preferred NuGet package for simplicity, or a thin package for developers who want to manage dependencies themselves.
The project maintains active development on the current branch while Harmony 3 development, including new Infix patching capabilities, proceeds on a separate branch. The maintainer has invested substantial effort into the project and actively solicits community support through sponsorship and contribution channels. Documentation and community discussion are available through dedicated resources including a Discord server.