Install-Package Lib.Harmony -Version 2.1.1
dotnet add package Lib.Harmony --version 2.1.1
<PackageReference Include="Lib.Harmony" Version="2.1.1" />
paket add Lib.Harmony --version 2.1.1
#r "nuget: Lib.Harmony, 2.1.1"
// Install Lib.Harmony as a Cake Addin #addin nuget:?package=Lib.Harmony&version=2.1.1 // Install Lib.Harmony as a Cake Tool #tool nuget:?package=Lib.Harmony&version=2.1.1
<p align="center"><img src="https://raw.githubusercontent.com/pardeike/Harmony/master/HarmonyLogo.png" alt="Harmony" width="128" /></p>
Harmony gives you an elegant and high level way to alter functionality in applications written in C#. It does this at runtime by monkey patching methods unlike other solutions that change the content of dll files.
It supports Mono and .NET environments on Windows, Unix and macOS except when Unity uses the stripped down NetStandard profile (.NET 4.x profile works fine). Harmony is used in mainstream Unity games and many other applications.
Designed to be used by multiple users (usually called Mods) that would otherwise override each others hooks, it was originally created for the game RimWorld and its large modding community by Andreas Pardeike.
You can learn more about Harmony by using the top menu links. The main section [Harmony] brings you to the full documentation that explains everything about Harmony and gives you lots of high level examples. In the second section [API Documentation] you can browse the public API and all its methods and classes.
If you find a factual error or if you have feedback about the documentation you are welcome to
- fork the repository and create a pull request
- file a documentation Issue on the repo
- or write about it on the official discord
New to modding and C#? Beside the basic language features you need at least a good overview of Reflection in C#. Read this short and useful introduction.
Help by promoting this library so other developers can find it. One way is to upvote this stackoverflow answer. Or spread the word in your developer communities. Thank you!
Donations keep me going:
NuGet packages (30)
Showing the top 5 NuGet packages that depend on Lib.Harmony:
Core service implementations for OpenMod
Mod loader and mod framework for Outer Wilds
A lightweight shared library for Rimworld modding.
A library for easy Setting integration. Contains the abstraction library, requires the Standalone dependency to work!
A library containing common functions for modification development. Built against e1.4.3.
GitHub repositories (16)
Showing the top 5 popular GitHub repositories that depend on Lib.Harmony:
Smart PVR for newsgroup and bittorrent users.
Unity support for both ReSharper and Rider
Source code for the Cities: Skylines Multiplayer mod (CSM)
USBHelperLauncher restores and enhances Wii U USB Helper functionality by patching it at runtime and intercepting its network requests.
.NET BMW and VAG Ediabas interpreter library