Need help with Harmony?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

pardeike
2.5K Stars 261 Forks MIT License 1.1K Commits 20 Opened issues

Description

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

Services available

!
?

Need anything else?

Contributors list

# 27,245
C#
monkey-...
cil
patcher
541 commits
# 50,480
C#
monkey-...
cil
patcher
197 commits
# 72,457
unpack
Unity
unity3d
monkey-...
94 commits
# 100,146
Unity
modding
net-fra...
monkey-...
27 commits
# 166,362
C#
monkey-...
cil
patcher
17 commits
# 174,341
monkey-...
cil
patcher
.NET
14 commits
# 211,488
C#
monkey-...
cil
patcher
9 commits
# 240,488
C#
monkey-...
cil
patcher
5 commits
# 79,700
C#
monkey-...
cil
sql-ser...
4 commits
# 65,275
C#
Unity
modding
net-fra...
3 commits
# 309,943
C#
monkey-...
cil
Unity
2 commits
# 41,194
D
reddit
Arch Li...
wxwidge...
2 commits
# 209,132
C#
monkey-...
cil
patcher
2 commits
# 335,772
C#
monkey-...
cil
patcher
2 commits
# 294,482
C#
monkey-...
cil
patcher
2 commits
# 397,648
C#
monkey-...
cil
patcher
1 commit
# 136,762
tailwin...
Laravel
React
php7
1 commit
# 256,595
c-sharp
monkey-...
cil
patcher
1 commit
# 378,183
Gradle
monkey-...
cil
patcher
1 commit
# 336,920
C#
monkey-...
cil
patcher
1 commit

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

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 7 Days To Die, BattleTech, Besiege, Cities:Skylines, Kerbal Space Program, Oxygen Not Included, Ravenfield, Rimworld, Sheltered, Stardew Valley, Staxel, Subnautica, The Ultimate Nerd Game, Total Miner, Unturned and many more.

It is also used in unit testing WPF controls 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

Installation is done by using 0Harmony.dll in your project or by using the Lib.Harmony nuget package.

Documentation

Please check out the documentation and join the official discord server.

Contribute

I put thousands of hours into this project and its support. So every little action helps:

• Upvote this stackoverflow answer
• Spread the word in your developer communities
• Become a GitHub sponsor or a Patreon

This project uses the great MonoMod.Common library by 0x0ade.

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.


 

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.