Skip to main content
net6.0net5.0net7.0net8.0net9.0net10.0

Flexible and easily extensible runtime detouring library. Wrap, replace and manipulate (Mono.Cecil) methods at runtime.

Published
Oct 3, 2026
20d ago
Total Downloads
3.6M
3,596,481

Install

dotnet add package MonoMod.RuntimeDetour --version 25.4.0-prerelease.1
ProductVersions
.NET
net10.0net11.0net5.0net6.0net7.0net8.0net9.0
.NET Standard
netstandard2.0netstandard2.1
Other
.NETFramework3.5.NETFramework4.5.2

README

Notable APIs

  • MonoMod.RuntimeDetour.Hook - An easy-to-use method hook
  • MonoMod.RuntimeDetour.ILHook - Modifies the IL of a method
  • MonoMod.RuntiemDetour.DetourContext - Persistent, shared detour configuration

Basic Usage

// Create a Hook.
using (var d = new Hook(methodInfoFrom, methodInfoTo))
{
    // When the detour goes out-of-scope (and thus has Dispose() called), the detour is undone.
    // If the object is collected by the garbage collector, the detour is also undone.
}

Visit the GitHub and look for RuntimeDetour for more documentation.

Changes from Previous Version

v25.3.6v25.4.0-prerelease.1
Added Frameworks
net11.0
Added Dependencies

Adoption Assessment

Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.

This version is marked prerelease. Validate its API and upgrade path before production use.Compatibility metadata lists 11 target frameworks; confirm the exact target used by your application.The published metadata declares 59 direct dependency entries across framework groups. Inspect the resolved dependency graph for your target framework.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.