Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
H

Harmony

> DevOps
Open source

A library for patching, replacing and decorating .NET and Mono methods during runtime

6.6K stars0 likes1 views
WebsiteGitHub

About

A library for patching, replacing and decorating .NET and Mono methods during runtime


Version 2.4
A library for patching, replacing and decorating
.NET and Mono methods during runtime.

This branch maintains Harmony 2.x. Harmony 3 development, including Infix patching, is on [v3](https://github.com/pardeike/Harmony/tree/v3). ### About Harmony gives you an elegant and high level way to alter the functionality in applications written in C#. It works great in games and is well established in titles like • **Rust** • **Rimworld** • **7 Days To Die** • **Stardew Valley** • **Subnautica** • **Oxygen Not Included** • **Besiege** • **Cities:Skylines** • **Kerbal Space Program** • **Resonite** • **BattleTech** • **Slime Rancher** • **Genshin Impact Miliastra Wonderland** and others like Ravenfield, Sheltered, Staxel, The Ultimate Nerd Game, Total Miner, Unturned, SCP: Secret Laboratory ... It is also used in unit testing WPF controls at Microsoft and Google and in many other areas. ### How it works If you develop in C# and your code is loaded as a module/plugin into a host application, you can use Harmony to alter the functionality of all the available assemblies of that application. Where other patch libraries simply allow you to replace the original method, Harmony goes one step further and gives you: • A way to keep the original method intact • Execute your code before and/or after the original method • Modify the original with IL code processors • Multiple Harmony patches co-exist and don't conflict with each other • Works at runtime and does not touch any files ### Installation If you want a single file, dependency-merged assembly, you should use the [Lib.Harmony](https://www.nuget.org/packages/Lib.Harmony) nuget package. This is the **preferred** way. If you instead want to supply the dependencies yourself, you should use the [Lib.Harmony.Thin](https://www.nuget.org/packages/Lib.Harmony.Thin) nuget package. You get more control but you are responsible to make all references available at runtime. ### Documentation Please check out the [documentation](https://harmony.pardeike.net) and join the official [discord server](https://discord.gg/xXgghXR). ### Contribute I put thousands of hours into this project and its support. So every little action helps: • Become a [GitHub sponsor](https://github.com/sponsors/pardeike) or a [Patreon](https://www.patreon.com/pardeike) • Upvote this [stackoverflow answer](https://stackoverflow.com/questions/7299097/dynamically-replace-the-contents-of-a-c-sharp-method/42043003#42043003) • Spread the word in your developer communities This project uses the great [MonoMod.Core](https://github.com/MonoMod) library by [0x0ade](https://github.com/0x0ade) and [nike4613](https://github.com/nike4613). ### Harmony 1 Harmony 1 is deprecated and not under active development anymore. The latest version of it (v1.2.0.1) is stable and contains only minor bugs. Keep using it if you are in an environment that exclusively uses Harmony 1. Currently Harmony 1.x and 2.x are **NOT COMPATIBLE** with each other and **SHOULD NOT BE MIXED**. The old documentation can still be found at the [Wiki](https://github.com/pardeike/Harmony/wiki).
 

Issues· 17 open

View all issuesOpen on GitHub
  • #780

    Evaluate reactive patch configuration as a host-side integration

    enhancementneeds more info/workUpdated Sep 8, 2026
  • #779

    Evaluate opt-in method-call profiling using existing patch APIs

    enhancementneeds more info/workUpdated Sep 8, 2026
  • #778

    Evaluate notifications for patch installation, rebuild and removal

    enhancementneeds more info/workUpdated Sep 8, 2026
  • #777

    Evaluate a dynamic reflection API against AccessTools and Traverse

    enhancementneeds more info/workUpdated Sep 8, 2026
  • #776

    Evaluate instruction types independent of Reflection.Emit

    enhancementneeds more info/workUpdated Sep 8, 2026
  • #775

    Design safe method-body import with local and label remapping

    enhancementneeds more info/workUpdated Sep 8, 2026
  • #774

    Design a transpiler context for labels and local variables

    enhancementneeds more info/workUpdated Sep 8, 2026
  • #773

    Evaluate a standalone HarmonyTools package and compatibility path

    enhancementneeds more info/workUpdated Sep 8, 2026
  • #772

    Benchmark delegate creation strategies before changing MethodDelegate

    enhancementneeds more info/workUpdated Sep 8, 2026
  • #771

    Add typed constructor delegate creation

    enhancementUpdated Sep 8, 2026

> Tags

C#cilcsharpdetourdetours

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 24, 2026
CategoryDevOps
PricingOpen source

> Related tools

D
Docker
容器化平台,标准化应用交付
G
GitHub Actions
GitHub 原生 CI/CD 工作流
N
Nginx
高性能 Web 服务器与反向代理