Skip to content

Bump Lib.Harmony from 2.2.2 to 2.4.2#110

Open
dependabot[bot] wants to merge 1 commit intomainfrom
dependabot/nuget/SpectatorDisabler/Lib.Harmony-2.4.2
Open

Bump Lib.Harmony from 2.2.2 to 2.4.2#110
dependabot[bot] wants to merge 1 commit intomainfrom
dependabot/nuget/SpectatorDisabler/Lib.Harmony-2.4.2

Conversation

@dependabot
Copy link
Copy Markdown
Contributor

@dependabot dependabot bot commented on behalf of github Feb 5, 2026

Updated Lib.Harmony from 2.2.2 to 2.4.2.

Release notes

Sourced from Lib.Harmony's releases.

2.4.2

Harmony 2.4.2 upgrades MonoMod.Core to v1.3.3 and now supports NET 10!

What's Changed

Full Changelog: pardeike/Harmony@v2.4.1.0...v2.4.2.0

2.4.1

Harmony v2.4.1 mainly fixes that v2.4 leaked types of Mono.Cecil.* to the public API.

What's Changed

Full Changelog: pardeike/Harmony@v2.4.0.0...v2.4.1.0

2.4

Harmony 2.4 includes a lot of bug fixes and now supports arm64!
Enjoy and consider supporting me on Patreon or become a GitHub sponsor!

Changelog

Added

  • Full support for arm64 across all operating systems, including Apple Silicon

  • Configurable error handler: A new API lets you register a global error handler that Harmony invokes whenever a patch throws an exception. This allows logging or suppressing errors centrally

  • Extended CodeMatcher API: New methods—RemoveSearchForward, RemoveSearchBackward, RemoveUntilForward, RemoveUntilBackward and Do—make it easier to remove or transform instruction sequences via CodeMatcher

  • Struct patching: [HarmonyPatch] attributes can now target methods defined in structs, not just classes

  • Additional MethodType cases: Harmony’s API now covers more method kinds (e.g., async methods, property accessors or operators). This broadens the range of targets you can patch

  • Simpler manual patch registration: The PatchClassProcessor no longer requires Harmony‑specific attributes when registering patches programmatically

Changed

  • Patch serialization: PatchInfo now uses ToArray() instead of MemoryStream.GetBuffer to serialize patches, improving compatibility across .NET runtimes

  • JSON serialization improvements: InnerMethod and patch classes gained custom System.Text.Json converters. Patch information now serializes round‑trip correctly and fields such as infixes were replaced with innerprefixes and innerpostfixes (new infix system)

  • Exception handling: try/fault blocks emitted by Harmony are now compiled as try/catch/finally and won't fail to patch anymore

Fixed

  • Correct index for local variables: CodeInstructionExtensions.LocalIndex now checks whether an operand is a LocalBuilder; it returns the correct LocalIndex instead of converting to int, preventing mis‑indexed local variables in transpilers

  • Infix negative position bug: Matching of negative positions in infix patches was corrected; positions counting from the end now compute the index properly

  • Argument validation for InnerMethod: Creating an InnerMethod now throws ArgumentNullException if method is null and ArgumentException if any position is zero, preventing silent errors

  • Stream memory handling: A bug where patch generation incorrectly used MemoryStream.GetBuffer (which could include unused capacity) was fixed; ToArray is now used instead

  • IL offset logging: IL offsets are logged again and reported accurately when debugging patched methods (commit referenced in release tag).

Removed

  • HarmonyException serialization: HarmonyException is no longer marked [Serializable], so it can no longer be marshalled across AppDomains or remoted contexts

New Contributors

Full Changelog: pardeike/Harmony@v2.3.6.0...v2.4.0.0

2.3.6

Oops in v2.3.5

  • #​633 fixes a binary compatibility issue present in 2.3.5 so if you have problems with 2.3.5 this release will fix them. Sorry for the inconvenience!

What's Changed

  • MethodDelegate now allows for swapping value type with object, and allow ref for arg 0 on value type #​633
  • Add CodeMatcher.InsertAfter and improve exception handling pardeike/Harmony@919f138
  • Use the proper instruction for TypeCode.DateTime and TypeCode.Decimal pardeike/Harmony@7e18ac1
  • Remove leftover debugger log #​653
  • Allow OpCodes.Ldstr in LoadsConstant #​656
  • Fix bug in handling __args argument with out bool parameters #​657 #​659 #​660
  • Add Test Case for #​657 #​658
  • Improve performance of AccessTools.TypeByName() pardeike/Harmony@a390e14
  • Add AccessTools.TypeSearch() pardeike/Harmony@a390e14

New Contributors

2.3.5

Fixes a regression/oversight in 2.3.4 that makes System.Text.Json 9.0.1 a dependency on all .NET versions

2.3.4

What's New

  • supports .NET 9
  • API landing page in the docs

What's Changed

  • updates to MonoMod.Core v1.2.3
  • updated version of ILRepack
  • updated readme with more game references
  • fixes Codes shortcuts, applies HarmonyArgument before special name lookup pardeike/Harmony@e8b4857
  • documentation fixes (incl. a CodeMatcher example by @​warquys)
  • bumped dependency versions
  • handle using object in place of value type, and vice versa pardeike/Harmony@e04f564
  • fixe NRE #​639
  • allows empty string for targeting special MethodType options and doesn't try searching for it with AccessTools pardeike/Harmony@0b13d7b
  • adds a test for #​640
  • net9 locking in FileLog 57ed506
  • handle constant/static readonly fields in MakeDeepCopy #​619
  • fixed wrong cache call in CallClosure() 22959ce
  • prevents infinite loop in CodeMatcher when using MatchStartBackwards/Repeat #​647

Known unsolved issues

  • methods returning bool? cannot be patched correctly (disabled test 81aa26a)

2.3.3

What's Changed

2.3.2

What's Changed

2.3.1.1

This releases fixes a regression for .Net Standard projects

2.3.1

v2.3.1 fixes:

  • Dependency problem / duplicate type errors that we introduced with v2.3
  • Better dead code handling #​584
  • new Lib.Harmony.Ref for projects targeting .NET Standard 2.0

2.3.0.1

This update updates Harmony Thin only and makes the dependency on MonoMod.Core public so it is included in transitive dependencies. No other changes.

2.3

We have been preparing and testing this for months and I want to specially mention the the help of our HUGE community on this release. Harmony is downloaded over 800 times a day and has over 1.6 million downloads on Nuget and a Discord server with over 2100 members.

New core engine
Harmony 2.3 now uses MonoMod.Core v1.1 (part of https://github.com/MonoMod) which is a rewrite of the low level back-end for patching .NET methods.

Support for newer .NET versions
.NET 7 and .NET 8 support is finally here

Tests via GitHub Actions
Harmony is now tested on Azure and GitHub and thus we can start testing macOS and other fancy combinations: https://github.com/pardeike/Harmony/actions/workflows/test.yml

Fat and Thin versions
Harmony is now released in two packages on nuget: Lib.Harmony and Lib.Harmony.Thin. The thin version does not embed dependencies and thus allows you to manage them yourself. The normal version embeds them as internal types and works as usual as a standalone dll.
https://www.nuget.org/packages/Lib.Harmony
https://www.nuget.org/packages/Lib.Harmony.Thin

Changes

  • Support GenericInstance types in inline method signatures 1960f575bddd04e9de617aa6af8b284c8383bb30
  • adds better detection for methods that end in dead code 7b5158aefb1aba88827fa598d5e37e67d1a58380
  • Merge pull request #​565 from Zetrith 03b642613f00ac8a7290df824785f07a357c6852
  • Error in exported Godot Engine build when attempting to patch method #​562
  • Regression with methods ending in throw + ret e63e183e315c30a4cc44db93a9484cd77d9492a6
  • fixes a bug where Harmony calls TargetMethods() always twice 7ab508c95e336619d0b77eb0918d74ac10fbcc2c
  • Native async patching is not available in .NET Standard or .NET #​533
  • adds IEnumerable.Matches() b9206db8abbe670f88e1fbe4a71f0986765f05ff
  • Uses PlatformTriple.Current.GetIdentifiable for a user submitted MethodInfo
  • fixes more unix tests
  • patches Assembly.GetExecutingAssembly internally
  • Improves http_client tests cda2226d2a9547c24f84521cfd3a894aea3a62f4
  • adds useful linux test shortcut c2586e7d0b2e2a73333b928eb0043e7c8542268a
  • adds null/zero return clarifcations for TargetMethod/s #​544
  • fixes CodeMatch(()=>... 7e4183ee30b886ec2f862412a70b92d2a16622cf
  • Documentation Auxiliary Methods - Attribute spelling issue. Plus logic fix. #​557
  • adds InnerTypes() and extensions for AccessTool methods on type Type d916a300d1e13b171b9a33fcf5dd7eab292d13ca
  • code cleanup, net8.0, optional ret code for methods ending in throw

Additions

  • adds Mono.Cecil.ByReferenceType, Mono.Cecil.GenericInstanceMethod, Mono.Cecil.GenericInstanceType, Mono.Cecil.TypeSpecification and Mono.Cecil.Cil.OpCodes to ForwardingAttributes
  • You can now patch methods like ref SomeType Test() by using ref RefResult<SomeType> __resultRef

Huge THANK YOU to all contributors (a lot of them new):

2.3.0-prerelease.7

This release is just like prerelease.6 but build with the new thin/fat mechanics.
No new features or fixes were added.

2.3.0-prerelease.6

Fixes the following issues:

  • Support GenericInstance types in inline method signatures 1960f575bddd04e9de617aa6af8b284c8383bb30
  • adds better detection for methods that end in dead code 7b5158aefb1aba88827fa598d5e37e67d1a58380
  • Merge pull request #​565 from Zetrith 03b642613f00ac8a7290df824785f07a357c6852

2.3.0-prerelease.5

Fixes

  • Error in exported Godot Engine build when attempting to patch method #​562
  • Regression with methods ending in throw + ret e63e183e315c30a4cc44db93a9484cd77d9492a6

2.3.0-prerelease.4

Changes

  • updates MonoMod.Core to v1.1.0-prerelease.1
  • fixes Native async patching is not available in .NET Standard or .NET #​533
  • adds IEnumerable.Matches() [b9206db8abbe670f88e1fbe4a71f0986765f05ff]
  • Uses PlatformTriple.Current.GetIdentifiable for a user submitted MethodInfo
  • fixes more unix tests
  • patches Assembly.GetExecutingAssembly internally
  • Improves http_client tests [cda2226d2a9547c24f84521cfd3a894aea3a62f4]
  • adds useful linux test shortcut [c2586e7d0b2e2a73333b928eb0043e7c8542268a]
  • adds null/zero return clarifcations for TargetMethod/s #​544
  • fixes CodeMatch(()=>... [7e4183ee30b886ec2f862412a70b92d2a16622cf]
  • Documentation Auxiliary Methods - Attribute spelling issue. Plus logic fix. #​557
  • adds InnerTypes() and extensions for AccessTool methods on type Type [d916a300d1e13b171b9a33fcf5dd7eab292d13ca]
  • code cleanup, net8.0, optional ret code for methods ending in throw

For the main description see v2.3-prerelease.2

2.3.0-prerelease.3

Fixes

  • fixes a bug where Harmony calls TargetMethods() always twice [7ab508c95e336619d0b77eb0918d74ac10fbcc2c]

Additions

  • adds Mono.Cecil.ByReferenceType, Mono.Cecil.GenericInstanceMethod, Mono.Cecil.GenericInstanceType, Mono.Cecil.TypeSpecification and Mono.Cecil.Cil.OpCodes to ForwardingAttributes

For the main description see v2.3-prerelease.2

2.3.0-prerelease.2

Harmony 2.3 now uses MonoMod.Core which is a rewrite of the low level backend for patching .net methods. We have been preparing and testing this for months but since so much has changed behind the scenes, the community need to step up and actively test if this release breaks things.

On the plus side, we now have .NET 7 support (yay!) and hopefully a bunch of bug fixes.

Harmony v2.3 also no longer merges Mono.Cecil into 0harmony.dll which means you probably need to supply it as a dependency yourself if you need it. The advantage on the other hand is that users who already use Cecil don't have any conflicts anymore.

New

What's Changed

New Contributors

Full Changelog: pardeike/Harmony@v2.2.2.0...v2.3-prerelease.2

Commits viewable in compare view.

Dependabot compatibility score

You can trigger a rebase of this PR by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Note
Automatic rebases have been disabled on this pull request as it has been open for over 30 days.

---
updated-dependencies:
- dependency-name: Lib.Harmony
  dependency-version: 2.4.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file .NET Pull requests that update .NET code labels Feb 5, 2026
@zochris
Copy link
Copy Markdown
Owner

zochris commented Feb 5, 2026

As long as EXILED uses version 2.2.2 I'll also stay on that version.

See ExMod-Team/EXILED#129

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file .NET Pull requests that update .NET code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant