diff --git a/src/MethodBoundaryAspect.Fody/MethodWeaver.cs b/src/MethodBoundaryAspect.Fody/MethodWeaver.cs index 206d34c..9e20382 100644 --- a/src/MethodBoundaryAspect.Fody/MethodWeaver.cs +++ b/src/MethodBoundaryAspect.Fody/MethodWeaver.cs @@ -178,6 +178,14 @@ private static MethodDefinition CloneMethod(MethodDefinition method) } } + if (method.DebugInformation?.Scope?.Scopes != null) + { + foreach (var scopeDebugInformation in method.DebugInformation.Scope.Scopes) + { + clonedMethod.DebugInformation.Scope.Scopes.Add(scopeDebugInformation); + } + } + return clonedMethod; }