Lib.Harmony 2.2.2

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

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

<p align="center"><img src="https://raw.githubusercontent.com/pardeike/Harmony/master/HarmonyLogo.png" alt="Harmony" width="128" /></p>

Harmony 2

Introduction

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.

Enjoy!
/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.

Documentation

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.

Community

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!

Contact

Andreas Pardeike
andreas@pardeike.net
twitter: @pardeike

Donations

Donations keep me going:
https://www.patreon.com/pardeike

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  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. 
.NET Core netcoreapp3.0 is compatible.  netcoreapp3.1 is compatible. 
.NET Framework net35 is compatible.  net40 was computed.  net403 was computed.  net45 is compatible.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 is compatible.  net48 is compatible.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (79)

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

Package Downloads
Allure.Xunit

Create beautiful reports from your xUnit.net tests.

Allure.SpecFlow

Create beautiful reports from your SpecFlow tests.

BrowserStack.TestAdapter

VS TestAdapter for integrating selenium tests with BrowserStack

WpfPilot

Next generation WPF automation testing.

NosePlug

A library for testing code that smells

GitHub repositories (38)

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

Repository Stars
Sonarr/Sonarr
Smart PVR for newsgroup and bittorrent users.
Revolutionary-Games/Thrive
The main repository for the development of the evolution game Thrive.
JetBrains/resharper-unity
Unity support for both ReSharper and Rider
SychicBoy/NETReactorSlayer
An open source (GPLv3) deobfuscator and unpacker for Eziriz .NET Reactor
skyarkhangel/Hardcore-SK
Rimworld Hardcore SK project, our discord server:
Version Downloads Last updated
2.3.3 308,329 3/29/2024
2.2.2 591,752 7/19/2022
1.2.0.1 180,342 8/8/2018