diff --git a/Harmony/Harmony.csproj b/Harmony/Harmony.csproj
index 8ba80c29..fee36dd7 100644
--- a/Harmony/Harmony.csproj
+++ b/Harmony/Harmony.csproj
@@ -96,7 +96,7 @@
-
+
diff --git a/Harmony/Internal/MethodPatcher.cs b/Harmony/Internal/MethodPatcher.cs
index 46acafe5..c66b1f1d 100644
--- a/Harmony/Internal/MethodPatcher.cs
+++ b/Harmony/Internal/MethodPatcher.cs
@@ -236,7 +236,10 @@ internal static DynamicMethodDefinition CreateDynamicMethod(MethodBase original,
patchName,
returnType,
parameterTypes.ToArray()
- );
+ )
+ {
+ OwnerType = original.DeclaringType
+ };
#if NETSTANDARD2_0 || NETCOREAPP2_0
#else
diff --git a/HarmonyTests/HarmonyTests.csproj b/HarmonyTests/HarmonyTests.csproj
index 5fe7e64b..b9c59a13 100644
--- a/HarmonyTests/HarmonyTests.csproj
+++ b/HarmonyTests/HarmonyTests.csproj
@@ -61,7 +61,7 @@
-
+