SonicGD.Lib.Harmony 2.3.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package SonicGD.Lib.Harmony --version 2.3.0
NuGet\Install-Package SonicGD.Lib.Harmony -Version 2.3.0
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="SonicGD.Lib.Harmony" Version="2.3.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SonicGD.Lib.Harmony --version 2.3.0
#r "nuget: SonicGD.Lib.Harmony, 2.3.0"
#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 SonicGD.Lib.Harmony as a Cake Addin
#addin nuget:?package=SonicGD.Lib.Harmony&version=2.3.0

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

<p align="center"> <img src="" alt="Harmony" width="180" /><br> <b>Version 2</b><br> A library for patching, replacing and decorating<br> .NET and Mono methods during runtime. </p>


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, SCP: Secret Laboratory 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 is done by using 0Harmony.dll in your project or by using the Lib.Harmony nuget package.


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


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.


<p align="center"> <a href="../../releases/latest"> <img src="" /> </a> <a href=""> <img src="" /> </a> <a href=""> <img src="" /> </a> </p> <p align="center"> <a href=""> <img src="" /> </a> <a href=""> <img src="" /> </a> <a href="../../blob/master/LICENSE"> <img src="" /> </a> </p> <p align="center"> <a href=""> <img src="" /> </a> <a href=""> <img src="" /> </a> </p>

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.3.1 426 9/7/2023
2.3.0 361 4/6/2023