Lib.Harmony 2.2.1

.NET 5.0 .NET Core 3.0 .NET Framework 3.5
There is a newer version of this package available.
See the version list below for details.
dotnet add package Lib.Harmony --version 2.2.1
NuGet\Install-Package Lib.Harmony -Version 2.2.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Lib.Harmony" Version="2.2.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Lib.Harmony --version 2.2.1
#r "nuget: Lib.Harmony, 2.2.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Lib.Harmony as a Cake Addin
#addin nuget:?package=Lib.Harmony&version=2.2.1

// Install Lib.Harmony as a Cake Tool
#tool nuget:?package=Lib.Harmony&version=2.2.1

<p align="center"><img src="" alt="Harmony" width="128" /></p>

Harmony 2


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.

/Andreas Pardeike

Getting Started

Installation is usually done by copying and referencing 0Harmony.dll from your project or by using the Lib.Harmony nuget package.


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.


If you feel stuck or have questions that this site does not answer, feel free to join the official Discord Server or file a GitHub Issue.

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!


Andreas Pardeike
twitter: @pardeike


Donations keep me going:

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows
.NET Core netcoreapp3.0 netcoreapp3.1
.NET Framework net35 net40 net403 net45 net451 net452 net46 net461 net462 net463 net47 net471 net472 net48 net481
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.
  • .NETCoreApp 3.0

  • .NETCoreApp 3.1

  • .NETFramework 3.5

    • No dependencies.
  • .NETFramework 4.5

    • No dependencies.
  • .NETFramework 4.7.2

    • No dependencies.
  • .NETFramework 4.8

    • No dependencies.
  • net5.0

NuGet packages (40)

Showing the top 5 NuGet packages that depend on Lib.Harmony:

Package Downloads
OpenMod.Core The ID prefix of this package has been reserved for one of the owners of this package by

Core service implementations for OpenMod


UI package for plugin development


A lightweight shared library for Rimworld modding.


Package Description


A library for testing code that smells

GitHub repositories (26)

Showing the top 5 popular GitHub repositories that depend on Lib.Harmony:

Repository Stars
Smart PVR for newsgroup and bittorrent users.
The main repository for the development of the evolution game Thrive.
Unity support for both ReSharper and Rider
.NET BMW and VAG Ediabas interpreter library
An open source (GPLv3) deobfuscator and unpacker for Eziriz .NET Reactor
Version Downloads Last updated
2.2.2 118,523 7/19/2022
2.2.1 91,017 3/12/2022 151,732 8/8/2018