Weaving fails with aspect inheritance
I have a situation where I want to implement 2 aspects: one to log exceptions and other to log and swallow them. Initially I had implemented them this way
public class LogExceptionAndThrowAttribute : OnMethodBoundaryAspect
{
public override void OnException(MethodExecutionArgs arg)
{
//Log exception
}
}
public class LogExceptionAndSwallowAttribute : LogExceptionAndThrowAttribute
{
public override void OnException(MethodExecutionArgs arg)
{
base.OnExcpetion(arg); //log exception using base method
//Set arg.returnvalue and FlowBehavior
}
}
The problem is that when I build the project, I get this error:
Exception: Sequence contains no matching element at System.Linq.Enumerable.Single[TSource](IEnumerable1 source, Func2 predicate) at ModuleWeaver.WeaveRealmObjectHelper(TypeDefinition realmObjectType) at ModuleWeaver.Execute() at lambda_method(Closure , Object ) at InnerWeaver.ExecuteWeavers() at InnerWeaver.Execute()
I implemented both aspects separately and now it works. I wanted to know if that's the expected behavior or it's an unexpected error.
Thank you.
seems like a bug