diff --git a/src/MethodBoundaryAspect.Fody/InstructionBlockChainCreator.cs b/src/MethodBoundaryAspect.Fody/InstructionBlockChainCreator.cs index 1e56eae..852f1f5 100644 --- a/src/MethodBoundaryAspect.Fody/InstructionBlockChainCreator.cs +++ b/src/MethodBoundaryAspect.Fody/InstructionBlockChainCreator.cs @@ -113,8 +113,7 @@ public NamedInstructionBlockChain CreateMethodExecutionArgsInstance( var createThisVariableBlock = CreateThisVariable(); // MethodExecutionArgs instance - var onEntryMethodTypeRef = - anyAspectTypeDefinition.Resolve().BaseType.Resolve().Methods.Single(AspectMethodCriteria.IsOnEntryMethod); + var onEntryMethodTypeRef = _referenceFinder.GetMethodReference(anyAspectTypeDefinition, AspectMethodCriteria.IsOnEntryMethod); var firstParameterType = onEntryMethodTypeRef.Parameters.Single().ParameterType; var methodExecutionArgsTypeRef = _moduleDefinition.ImportReference(firstParameterType); @@ -433,4 +432,4 @@ private static MethodReference FixMethodReference(TypeReference declaringType, M return targetMethod; } } -} \ No newline at end of file +}